public void Perform(WorkItemDelegate item)
 {
     lock (FLock)
     {
         FWorkQueue.Enqueue(item);
     }
 }
Esempio n. 2
0
		public void Perform(WorkItemDelegate item)
		{
			lock (FLock)
			{
				FWorkQueue.Enqueue(item);
			}
		}
 public void PerformUnique(WorkItemDelegate item)
 {
     lock (FLock)
     {
         if (!FWorkQueue.Contains(item))
         {
             FWorkQueue.Enqueue(item);
         }
     }
 }
 public void PerformBlocking(WorkItemDelegate item)
 {
     if (Thread.CurrentThread == this.FThread)
     {
         //we're already inside the worker thread
         item();
     }
     else
     {
         Perform(item);
         BlockUntilEmpty();
         if (this.FException != null)
         {
             var e = this.FException;
             this.FException = null;
             throw (e);
         }
     }
 }
Esempio n. 5
0
		public void PerformBlocking(WorkItemDelegate item)
		{
			if (Thread.CurrentThread == this.FThread)
			{
				//we're already inside the worker thread
				item();
			}
			else
			{
				Perform(item);
				BlockUntilEmpty();
				if (this.FException != null)
				{
					var e = this.FException;
					this.FException = null;
					throw (e);
				}
			}
		}
Esempio n. 6
0
		public void PerformUnique(WorkItemDelegate item)
		{
			lock (FLock)
			{
				if (!FWorkQueue.Contains(item))
					FWorkQueue.Enqueue(item);
			}
		}