public void awaitShutdown() throws InterruptedException {
  lock.lockInterruptibly();
  try {
    while (true) {
switch (runState) {
case Start:
case Running:
case ShuttingDown:
        futureReady.await();
      continue;
case Shutdown:
    return;
default :
  throw new AssertionError();
}
}
}
  finally {
lock.unlock();
}
}

public void awaitShutdown ( ) throws InterruptedException { lock . lockInterruptibly ( ) ; try { while ( true ) { switch ( runState ) { case Start : case Running : case ShuttingDown : futureReady . await ( ) ; continue ; case Shutdown : return ; default : throw new AssertionError ( ) ; } } } finally { lock . unlock ( ) ; } }
block until the service is shutdown .
