Permalink
Browse files

FIX: prevent KeyNotFoundException on enqueueing task

  • Loading branch information...
Michal Staszewski
Michal Staszewski committed Jun 21, 2011
1 parent 7459063 commit 058b156c4d1631645ca7b00d95c411bbda0ace82
Showing with 3 additions and 3 deletions.
  1. +3 −3 SmartThreadPool/SmartThreadPool.cs
@@ -622,11 +622,11 @@ private void StartThreads(int threadsCount)
#if !(_SILVERLIGHT)
workerThread.Priority = _stpStartInfo.ThreadPriority;
#endif
workerThread.Start();
++_threadCounter;
// Add it to the dictionary and update its creation time.
_workerThreads[workerThread] = new ThreadEntry(this);
workerThread.Start();
++_threadCounter;
_windowsPCs.SampleThreads(_workerThreads.Count, _inUseWorkerThreads);
_localPCs.SampleThreads(_workerThreads.Count, _inUseWorkerThreads);

0 comments on commit 058b156

Please sign in to comment.