Fixed thread creation when queuing many work items at the same time.

This solves item 2966 (http://smartthreadpool.codeplex.com/workitem/2966) reported by Raccoon and etichy.
This commit is contained in:
Ami Bar
2012-07-06 16:42:10 +03:00
parent 10633fdf9f
commit 50a6b71d50
+1 -1
View File
@@ -524,7 +524,7 @@ namespace Amib.Threading
workItem.WorkItemIsQueued();
// If all the threads are busy then try to create a new one
if ((InUseThreads + WaitingCallbacks) > _workerThreads.Count)
if (_currentWorkItemsCount > _workerThreads.Count)
{
StartThreads(1);
}