if (lockCount++ == 0) { Thread t = new Thread(this); t.setDaemon(false); t.start(); }
if (--lockCount == 0) { notify(); }
while (lockCount != 0) { try { wait(); } catch (InterruptedException ex) {}; }