public void unlock() {
		ArrayList<Runnable> list;
		synchronized (this) {
			locked = false;
			list = listeners;
			listeners = null;
		}
		if (list != null) {
			for (Runnable r : list) r.run();
		}
		// notify after listeners
		synchronized (this) {
			this.notifyAll();
		}
	}
public void unlock ( ) { ArrayList < Runnable > list ; synchronized ( this ) { locked = false ; list = listeners ; listeners = null ; } if ( list != null ) { for ( Runnable r : list ) r . run ( ) ; } synchronized ( this ) { this . notifyAll ( ) ; } }
Release the lock.