public void add(Message message){
  message.acquire();
  lock.lock();
  try {
    workQueue.add(message);
    queueEmpty.signal();
  }
  finally {
    lock.unlock();
  }
}

public void add ( Message message ) { message . acquire ( ) ; lock . lock ( ) ; try { workQueue . add ( message ) ; queueEmpty . signal ( ) ; } finally { lock . unlock ( ) ; } }
adds the message to the queue to be saved . the savedindex will be advanced if the message is successfully stored .
