Пример #1
0
 public void AddDocument(Document1 doc)
 {
     lock (this)
     {
         document1Queue.Enqueue(doc);
     }
 }
Пример #2
0
        public Document1 GetDocument()
        {
            Document1 doc = null;

            lock (this)
            {
                doc = document1Queue.Dequeue();
            }
            return(doc);
        }
Пример #3
0
 protected void Run()
 {
     while (true)
     {
         if (document1Manager.IsDocumentAvailable)
         {
             Document1 doc = document1Manager.GetDocument();
         }
         Thread.Sleep(new Random().Next(20));
     }
 }