Exemple #1
0
        private void AddTask(HouseTask task)
        {
            lock (fQueue)
            {
                fQueue.Enqueue(task);
            }

            fSignal.Set();
        }
Exemple #2
0
        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);
        }