public void doWork()
{
// Perform some actions.
this.setTimeOut(identifierstr(workerFunction), 0);
this.wait(); // Lock and wait for notify to be called.
}
public void workerFunction()
{
// Perform some actions.
// Work is done; unlock the doWork method.
this.notify();
}