synchronized( this ){
queue.add( target );
if ( thread == null ){
thread =
new AEThread( "AsyncDispatcher", true )
{
public void
runSupport()
{
while( true ){
queue_sem.reserve( quiesce_after_millis );
AERunnable to_run = null;
synchronized( AsyncDispatcher.this ){
if ( queue.isEmpty()){
thread = null;
break;
}
to_run = (AERunnable)queue.removeFirst();
}
try{
to_run.runSupport();
}catch( Throwable e ){
Debug.printStackTrace(e);
}
}
}
};
thread.start();
}
}
queue_sem.release();