internal static void OnUnhandledThreadPoolException(ThreadPoolItem item, Exception exception) { var tmp = UnhandledThreadPoolException; if (tmp != null) { tmp(item.State, exception); } }
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); } } }