public void QueueUserWorkItem(WaitCallback callback, object state) { IDisposable token = Counter.AcquireToken(); ThreadWrapperContext twc = new ThreadWrapperContext(callback, state, token, ExceptionList); if (UseFXThreadPool) { System.Threading.ThreadPool.QueueUserWorkItem(new WaitCallback(twc.ThreadWrapper), twc); } else { Thread thread = new Thread(new ThreadStart(twc.ThreadWrapper)); thread.IsBackground = true; thread.Start(); } }
public void QueueUserWorkItem(WaitCallback callback, object state) { IDisposable token = this.counter.AcquireToken(); ThreadWrapperContext twc = new ThreadWrapperContext(callback, state, token, this.exceptions); if (this.counter.Max == 1) { twc.ThreadWrapper(twc); } else if (this.useFXTheadPool) { ThreadPool.QueueUserWorkItem(new WaitCallback(twc.ThreadWrapper), twc); } else { Thread thread = new Thread(new ThreadStart(twc.ThreadWrapper)); thread.IsBackground = true; thread.Start(); } }
public void QueueUserWorkItem(WaitCallback callback, object state) { IDisposable token = counter.AcquireToken(); ThreadWrapperContext twc = new ThreadWrapperContext(callback, state, token, this.exceptions); if (this.useFXTheadPool) { System.Threading.ThreadPool.QueueUserWorkItem(new WaitCallback(twc.ThreadWrapper), twc); } else { Thread thread = new Thread(new ThreadStart(twc.ThreadWrapper)); thread.IsBackground = true; thread.Start(); } }