コード例 #1
0
 public void Release()
 {
     if (taskManager != null)
     {
         taskManager.Release();
         taskManager = null;
         hosts.Clear();
     }
 }
コード例 #2
0
        public void ReleaseSharedTaskManager(ITaskManager itaskManager)
        {
            if (itaskManager == null)
            {
                return;
            }
            if (!(itaskManager is TaskManager))
            {
                return;
            }
            TaskManager taskManager = (TaskManager)itaskManager;

            if (sharedTaskManagers.Contains(taskManager))
            {
                Interlocked.Decrement(ref taskManager.sharedCount);
                if (taskManager.sharedCount == 0)
                {
                    taskManager.Release();
                    sharedTaskManagers.Remove(taskManager);
                }
            }
        }