コード例 #1
0
 public void Perform(WorkItemDelegate item)
 {
     lock (FLock)
     {
         FWorkQueue.Enqueue(item);
     }
 }
コード例 #2
0
		public void Perform(WorkItemDelegate item)
		{
			lock (FLock)
			{
				FWorkQueue.Enqueue(item);
			}
		}
コード例 #3
0
 public void PerformUnique(WorkItemDelegate item)
 {
     lock (FLock)
     {
         if (!FWorkQueue.Contains(item))
         {
             FWorkQueue.Enqueue(item);
         }
     }
 }
コード例 #4
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);
         }
     }
 }
コード例 #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);
			}
		}