Beispiel #1
0
 internal void UnregisterWorkItemsGroup(IWorkItemsGroup workItemsGroup)
 {
     if (_workItemsGroups.Contains(workItemsGroup))
     {
         _workItemsGroups.Remove(workItemsGroup);
     }
 }
Beispiel #2
0
 /// <summary>
 /// Inform that the current thread is about to quit or quiting.
 /// The same thread may call this method more than once.
 /// </summary>
 private void InformCompleted()
 {
     // There is no need to lock the two methods together
     // since only the current thread removes itself
     // and the _workerThreads is a synchronized dictionary
     if (_workerThreads.Contains(Thread.CurrentThread))
     {
         _workerThreads.Remove(Thread.CurrentThread);
         _windowsPCs.SampleThreads(_workerThreads.Count, _inUseWorkerThreads);
         _localPCs.SampleThreads(_workerThreads.Count, _inUseWorkerThreads);
     }
 }