/**
  * Free the pool resources that are held by this WriteStream. The pool itself is thread local and
  * will be freed when the thread terminates.
  */
 @Override
 synchronized void shutdown() {
   super.shutdown();
   DeferredSerialization ds = null;
   while ((ds = m_queuedWrites.poll()) != null) {
     ds.cancel();
   }
 }
 public void enqueue(DeferredSerialization ds) {
   if (m_isShutdown) {
     ds.cancel();
     return;
   }
   m_queuedWrites.offer(ds);
 }