@@ -0,0 +1,638 @@
+package ru.job4j.waitnotify;%0A%0A/**%0A * Myself implementation of lock algorithm.%0A */%0Apublic class MyLock %7B%0A    /**%0A     * lock flag; true, if this object is locked.%0A     */%0A    private boolean isLocked = false;%0A%0A    /**%0A     * lock changes in locked object.%0A     */%0A    synchronized void lock() %7B%0A        while (isLocked) %7B%0A            try %7B%0A                wait();%0A            %7D catch (InterruptedException e) %7B%0A                e.printStackTrace();%0A            %7D%0A            isLocked = true;%0A        %7D%0A    %7D%0A%0A    /**%0A     * free locked object.%0A     */%0A    synchronized void unlock() %7B%0A        isLocked = false;%0A        notifyAll();%0A    %7D%0A%7D%0A

Task #1100