예제 #1
0
        private void ThreadProc()
        {
            while (thread != null)
            {
                try
                {
                    waitEvent.WaitOne();

                    if (thread != null && item != null)
                    {
                        item.Callback(item.State);
                    }
                }
                // ReSharper disable once EmptyGeneralCatchClause
                catch (Exception ex)
                {
                    ThreadPool.OnUnhandledThreadPoolException(Item, ex);
                }

                if (thread != null)
                {
                    waitEvent.Reset();
                    item   = null;
                    IsBusy = ThreadPool.NotifyThreadIdle(this);
                }
            }
        }