public synchronized void postRunnable(Runnable r)
{
try
{
if (gentle_close_requested)
throw new ResourceClosedException("Attempted to post a task to a closing " +
"CarefulRunnableQueue.");
taskList.add(r);
this.notifyAll();
}
catch (NullPointerException e)
{
//e.printStackTrace();
if (Debug.DEBUG)
{
if ( logger.isLoggable( MLevel.FINE ) )
logger.log( MLevel.FINE, "NullPointerException while posting Runnable.", e );
}
if (taskList == null)
throw new ResourceClosedException("Attempted to post a task to a CarefulRunnableQueue " +
"which has been closed, or whose TaskThread has been " +
"interrupted.");
else
throw e;
}