public void Perform(WorkItemDelegate item)
 {
     lock (FLock)
     {
         FWorkQueue.Enqueue(item);
     }
 }
示例#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);
         }
     }
 }
示例#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);
				}
			}
		}
示例#6
0
		public void PerformUnique(WorkItemDelegate item)
		{
			lock (FLock)
			{
				if (!FWorkQueue.Contains(item))
					FWorkQueue.Enqueue(item);
			}
		}