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

            if (tmp != null)
            {
                tmp(item.State, exception);
            }
        }
Exemplo n.º 4
0
 internal static void OnUnhandledThreadPoolException(ThreadPoolItem item, Exception exception)
 {
     var tmp = UnhandledThreadPoolException;
      if (tmp != null)
      {
     tmp(item.State, exception);
      }
 }