/*
   * (non-Javadoc)
   *
   * @see poke.server.ChannelQueue#shutdown(boolean)
   */
  @Override
  public void shutdown(boolean hard) {
    logger.info("server is shutting down");

    channel = null;

    if (hard) {
      // drain queues, don't allow graceful completion
      inbound.clear();
      outbound.clear();
    }

    if (iworker != null) {
      iworker.forever = false;
      if (iworker.getState() == State.BLOCKED || iworker.getState() == State.WAITING)
        iworker.interrupt();
      iworker = null;
    }

    if (oworker != null) {
      oworker.forever = false;
      if (oworker.getState() == State.BLOCKED || oworker.getState() == State.WAITING)
        oworker.interrupt();
      oworker = null;
    }
  }
 public void releaseSelf() {
   mRequestQueue.clear();
   synchronized (mSync) {
     if (mIsRunning) {
       offerFirst(REQUEST_EGL_TASK_QUIT, 0, null);
       mIsRunning = false;
     }
   }
 }
 /** request terminate worker thread and release all related resources */
 public void release() {
   mRequestQueue.clear();
   synchronized (mSync) {
     if (mIsRunning) {
       offerFirst(REQUEST_EGL_TASK_QUIT, 0, null);
       mIsRunning = false;
       try {
         mSync.wait();
       } catch (final InterruptedException e) {
         // ignore
       }
     }
   }
 }
 /** File Stream Methods. * */
 @Override
 public void resetBuffersInternal() {
   if (activeCommandList != null) {
     activeCommandList.clear();
   }
 }