code: public void lock() {
  		if (cancel != null)
  			return;
  		if (error != null)
  			return;
  		Thread t;
  		BlockedThreadHandler blockedHandler;
  		do {
  			synchronized (this) {
  				if (!locked) {
  					locked = true;
  					return;
  				}
  				t = Thread.currentThread();
  				blockedHandler = Threading.getBlockedThreadHandler(t);
  				if (blockedHandler != null) break;
  				try { this.wait(0); }
  				catch (InterruptedException e) { continue; }
  			}
  		} while (true);
  		blockedHandler.blocked(this, 0);
  	}
docs: Request the lock. If it is already locked this method will block until it become unblocked and the lock has been obtained.