예제 #1
0
 public void SupplyBuffer(Buffer b)
 {
     lock (this)
     {
         if (interrupted)
         {
             log.LogAssert("Got supplied buffer after being interrupted");
         }
         queue.Enqueue(b);
     }
 }
예제 #2
0
파일: StreamWriter.cs 프로젝트: xyuan/Dryad
        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);
            }
        }