Ejemplo n.º 1
0
 /// <summary>
 /// 存储过程
 /// </summary>
 private void ProcStore()
 {
     while (true)
     {
         if (blockReceivedEvent.WaitOne())
         {
             IDataProcessBlock block = null;
             lock (((ICollection)queueDataBlock).SyncRoot)
             {
                 if (this.queueDataBlock.Count > 0)
                 {
                     block = queueDataBlock.Dequeue();
                 }
                 else
                 {
                     blockReceivedEvent.Reset();
                 }
             }
             if (block != null)
             {
                 bool goon = block.Process();
                 if (!goon)
                 {
                     break;
                 }
             }
         }
     }
 }
Ejemplo n.º 2
0
 public void PutDataBlock(IDataProcessBlock block)
 {
     lock (((ICollection)queueDataBlock).SyncRoot)
     {
         queueDataBlock.Enqueue(block);
         blockReceivedEvent.Set();
     }
 }
Ejemplo n.º 3
0
 public void AddBlock(IDataProcessBlock blk)
 {
     lock (((ICollection)queueBlock).SyncRoot)
     {
         if (queueBlock.Count > 1000)
         {
             queueBlock.Dequeue();
         }
         queueBlock.Enqueue(blk);
         eventBlk.Set();
     }
 }
Ejemplo n.º 4
0
 public void AddBlock(IDataProcessBlock blk)
 {
     lock (((ICollection)queueBlock).SyncRoot)
     {
         if (queueBlock.Count > 1000)
         {
             queueBlock.Dequeue();
         }
         queueBlock.Enqueue(blk);
         eventBlk.Set();
     }
 }
Ejemplo n.º 5
0
 public void PutDataBlock(IDataProcessBlock block)
 {
     lock (((ICollection)queueDataBlock).SyncRoot)
     {
         queueDataBlock.Enqueue(block);
         blockReceivedEvent.Set();
     }
 }