mirror of
https://github.com/farcasclaudiu/SmartThreadPool.git
synced 2026-06-28 11:01:04 +03:00
Added support for Silverlight and Mono (And more)
Also added: * Join, Choice, and Pipe to SmartThreadPool. * Local performance counters (for Mono, Silverlight, and WindowsCE)
This commit is contained in:
@@ -152,5 +152,23 @@ namespace WorkItemsGroupTests
|
||||
|
||||
smartThreadPool.Shutdown();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void WaitForIdleEvent()
|
||||
{
|
||||
SmartThreadPool smartThreadPool = new SmartThreadPool();
|
||||
IWorkItemsGroup workItemsGroup = smartThreadPool.CreateWorkItemsGroup(1);
|
||||
ManualResetEvent wigIsIdle = new ManualResetEvent(false);
|
||||
|
||||
workItemsGroup.OnIdle += wig => wigIsIdle.Set();
|
||||
|
||||
workItemsGroup.QueueWorkItem(() => { });
|
||||
|
||||
bool eventFired = wigIsIdle.WaitOne(100, true);
|
||||
|
||||
smartThreadPool.Shutdown();
|
||||
|
||||
Assert.IsTrue(eventFired);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user