private void AddTask(HouseTask task) { lock (fQueue) { fQueue.Enqueue(task); } fSignal.Set(); }
protected bool ProcessOne() { bool result = false; HouseTask e = null; lock (fQueue) { if (fQueue.Count > 0) { e = fQueue.Dequeue(); } } if (e != null) { e.Invoke(); result = true; } return(result); }