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