protected void checkPauseAndWait(){
  pauseLock.lock();
  try {
    while (paused && !stopped) {
      pausedCondition.await();
    }
  }
 catch (  InterruptedException e) {
  }
 finally {
    pauseLock.unlock();
  }
}

protected void checkPauseAndWait ( ) { pauseLock . lock ( ) ; try { while ( paused && ! stopped ) { pausedCondition . await ( ) ; } } catch ( InterruptedException e ) { } finally { pauseLock . unlock ( ) ; } }
this method is run by threads in the threadpool and checks if the scan is paused and , if it is , waits until it ' s unpaused .
