@@ -0,0 +1,634 @@
+package ru.szhernovoy.lock;%0A%0A/**%0A * Created by admin on 26.10.2016.%0A */%0Apublic class Locker %7B%0A%0A    private Object lock = new Object();%0A    private boolean flag = false;%0A%0A%0A    public void lockOject()%7B%0A        synchronized (this.lock)%7B%0A            while(this.flag)%7B%0A                try %7B%0A                    lock.wait();%0A                %7D catch (InterruptedException e) %7B%0A                    e.printStackTrace();%0A                %7D%0A            %7D%0A            this.flag = true;%0A        %7D%0A    %7D%0A%0A    public void unlockObject()%7B%0A        synchronized (this.lock)%7B%0A            flag = false;%0A            this.lock.notify();%0A        %7D%0A    %7D%0A%0A%0A%7D%0A

add Locker