@GuardedBy("idleLock") void drainTaskStack(int threshold){
  for (int ran=0; ran < threshold; ran++) {
    Runnable task=taskStack.pop();
    if (task == null) {
      return;
    }
    task.run();
  }
}

@ GuardedBy ( "idleLock" ) void drainTaskStack ( int threshold ) { for ( int ran = 0 ; ran < threshold ; ran ++ ) { Runnable task = taskStack . pop ( ) ; if ( task == null ) { return ; } task . run ( ) ; } }
applies the pending operations , up to the threshold limit , in the task queue .
