public void waitUntilFree(){
  while (isBusy()) {
    sendEmptyMessage(BLANK);
    lock.lock();
    try {
      if (isBusy()) {
        busyCondition.await();
      }
    }
 catch (    InterruptedException e) {
      throw new RuntimeException(e);
    }
 finally {
      lock.unlock();
    }
  }
}

public void waitUntilFree ( ) { while ( isBusy ( ) ) { sendEmptyMessage ( BLANK ) ; lock . lock ( ) ; try { if ( isBusy ( ) ) { busyCondition . await ( ) ; } } catch ( InterruptedException e ) { throw new RuntimeException ( e ) ; } finally { lock . unlock ( ) ; } } }
blocks the calling thread until all work has been processed .
