Ejemplo n.º 1
0
        internal static void OnUnhandledThreadPoolException(ThreadPoolItem item, Exception exception)
        {
            var tmp = UnhandledThreadPoolException;

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