コード例 #1
0
 private static void StopGlobalQueuedExecutionService()
 {
     if (_globalAbortableQueuedExecutionService != null)
     {
         _globalAbortableQueuedExecutionService.Dispose();
         _globalAbortableQueuedExecutionService = null;
     }
 }
コード例 #2
0
        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);
            }
        }