private static void StopGlobalQueuedExecutionService() { if (_globalAbortableQueuedExecutionService != null) { _globalAbortableQueuedExecutionService.Dispose(); _globalAbortableQueuedExecutionService = null; } }
public static ChoAbortableQueuedExecutionService GetService(string name) { ChoAbortableQueuedExecutionService queuedExecutionService = null; if (_globalQueuedExecutionServices.TryGetValue(name, out queuedExecutionService)) { return(queuedExecutionService); } lock (_globalQueuedExecutionServices.SyncRoot) { if (_globalQueuedExecutionServices.TryGetValue(name, out queuedExecutionService)) { return(queuedExecutionService); } queuedExecutionService = new ChoAbortableQueuedExecutionService(name, true); _globalQueuedExecutionServices.Add(name, queuedExecutionService); return(queuedExecutionService); } }