Example #1
0
        public void QueueUserWorkItem(WaitCallback worker, Object arg)
        {
            worker.ThrowIfNull(nameof(worker));

            lock ( _syncRoot )
            {
                _workQueue.Enqueue(new(worker, arg) );

                if (_running)
                {
                    return;
                }
                _executionComplete.Reset();
                _running = true;
                ThreadPool.QueueUserWorkItem(QueueProcessor, null);
            }
        }