public void SupplyBuffer(Buffer b) { lock (this) { if (interrupted) { log.LogAssert("Got supplied buffer after being interrupted"); } queue.Enqueue(b); } }
public bool Write(Buffer buffer) { lock (this) { if (writes == null) { log.LogError("Got write buffer after close"); throw new ApplicationException("Got write buffer after close"); } int buffersInQueue = writes.Enqueue(buffer); return(buffersInQueue > 4); } }