private void DoWorkOrWait() { DataBlock current; do { m_queue.DequeueOrWait(out current); if (current != null) { var transformed = Transform(current); m_outputStream.Write(transformed); } } while (current != null && !m_interrupted); }