SmartThreadPool v2.0
This commit is contained in:
Ami Bar
2009-12-19 16:32:41 +02:00
parent b30b4abdda
commit 4d6ffb5851
89 changed files with 13714 additions and 2639 deletions
+7 -5
View File
@@ -28,15 +28,17 @@ namespace SmartThreadPoolTests
SmartThreadPool smartThreadPool = new SmartThreadPool(10*1000, 25, 0);
bool success = false;
ManualResetEvent isRunning = new ManualResetEvent(false);
for(int i = 0; i < 100; ++i)
for(int i = 0; i < 4; ++i)
{
smartThreadPool.QueueWorkItem(
new WorkItemCallback(this.DoSomeWork),
null);
smartThreadPool.QueueWorkItem(delegate { isRunning.WaitOne(); });
}
success = !smartThreadPool.WaitForIdle(3500);
success = !smartThreadPool.WaitForIdle(1000);
isRunning.Set();
success = success && smartThreadPool.WaitForIdle(1000);
smartThreadPool.Shutdown();