/// <summary> /// Queues a method for execution. /// The method executes when a thread pool thread becomes available. /// </summary> /// <param name="proc"></param> /// <returns></returns> public static bool QueueUserWorkItem(WaitCallbackNew callback) { WaitCallbackHelper wcbh = new WaitCallbackHelper(); wcbh.Callback = callback; wcbh.WaitHandle = new AutoResetEvent(false); if (AutoResetEvents == null) { AutoResetEvents = new List<WaitHandle>(); } AutoResetEvents.Add(wcbh.WaitHandle); return ThreadPool.QueueUserWorkItem(new WaitCallback(Callback), wcbh); }
public static bool QueueUserWorkItem(WaitCallbackNew callback) { Class26 state = new Class26(); state.method_1(callback); state.method_3(new AutoResetEvent(false)); if (list_0 == null) { list_0 = new List <WaitHandle>(); } list_0.Add(state.method_2()); return(ThreadPool.QueueUserWorkItem(new WaitCallback(ThreadPoolHelper.smethod_0), state)); }
/// <summary> /// Queues a method for execution. /// The method executes when a thread pool thread becomes available. /// </summary> /// <param name="proc"></param> /// <returns></returns> public static bool QueueUserWorkItem(WaitCallbackNew callback) { WaitCallbackHelper wcbh = new WaitCallbackHelper(); wcbh.Callback = callback; wcbh.WaitHandle = new AutoResetEvent(false); if (AutoResetEvents == null) { AutoResetEvents = new List <WaitHandle>(); } AutoResetEvents.Add(wcbh.WaitHandle); return(ThreadPool.QueueUserWorkItem(new WaitCallback(Callback), wcbh)); }