public static TryRegisterCallback ( System.Action callback, ShutdownHandlerOrder shutdownOrder = ShutdownHandlerOrder.Default ) : bool | ||
callback | System.Action | the callback when the shutdown occurs |
shutdownOrder | ShutdownHandlerOrder | the order that the callback will occur. |
return | bool |
public ThreadContainerThreadpool(Action <CallbackArgs> callback, Action disposeAndWaitCallback, bool disposeOnShutdown) : base(callback, disposeAndWaitCallback, disposeOnShutdown) { if (disposeOnShutdown) { ShutdownHandler.TryRegisterCallback(Shutdown); } m_waitObject = new ManualResetEvent(false); }
public ThreadContainerDedicated(Action <CallbackArgs> callback, Action disposeAndWaitCallback, bool isBackground, ThreadPriority priority, bool disposeOnShutdown) : base(callback, disposeAndWaitCallback, disposeOnShutdown) { m_isBackground = isBackground; if (disposeOnShutdown || !isBackground) { ShutdownHandler.TryRegisterCallback(Shutdown); } m_shouldReRunImmediately = false; m_shouldReRunAfterDelay = false; m_threadPausedWaitHandler = new ManualResetEvent(false); m_threadSleepWaitHandler = new ManualResetEvent(false); m_thread = new Thread(ThreadLoop); m_thread.IsBackground = isBackground; m_thread.Priority = priority; m_thread.Start(); }