public Future<T> backgroundTaskFinished(final Callable<T> cleanupTask) {
      QueueingTask futureTask = null;
      if (cleanupTask != null) {
         if (trace) log.tracef("Background task finished, executing cleanup task");
         futureTask = new QueueingTask(cleanupTask);
         executor.execute(futureTask);
      } else {
         semaphore.release();
         if (trace) log.tracef("Background task finished, available permits %d", semaphore.availablePermits());
         executeFront();
      }
      return futureTask;
   }
public Future < T > backgroundTaskFinished ( final Callable < T > cleanupTask ) { QueueingTask futureTask = null ; if ( cleanupTask != null ) { if ( trace ) log . tracef ( "Background task finished, executing cleanup task" ) ; futureTask = new QueueingTask ( cleanupTask ) ; executor . execute ( futureTask ) ; } else { semaphore . release ( ) ; if ( trace ) log . tracef ( "Background task finished, available permits %d" , semaphore . availablePermits ( ) ) ; executeFront ( ) ; } return futureTask ; }
Signal that a task that called {@link #continueTaskInBackground()} has finished and
optionally execute another task on the just-freed thread.