EventWaitHandleFactory class. This is a static class that creates AutoResetEvent and ManualResetEvent objects. In WindowCE the WaitForMultipleObjects API fails to use the Handle property of XxxResetEvent. It can use only handles that were created by the CreateEvent API. Consequently this class creates the needed XxxResetEvent and replaces the handle if it's a WindowsCE OS.
コード例 #1
0
ファイル: WorkItem.cs プロジェクト: nnazim/SmartThreadPool
 /// <summary>
 /// A wait handle to wait for completion, cancel, or timeout
 /// </summary>
 private WaitHandle GetWaitHandle()
 {
     lock (this)
     {
         if (null == _workItemCompleted)
         {
             _workItemCompleted = EventWaitHandleFactory.CreateManualResetEvent(IsCompleted);
         }
         ++_workItemCompletedRefCount;
     }
     return(_workItemCompleted);
 }