Amib.Threading.Internal.EventWaitHandleFactory.CreateManualResetEvent C# (CSharp) Method

CreateManualResetEvent() public static method

Create a new ManualResetEvent object
public static CreateManualResetEvent ( bool initialState ) : ManualResetEvent
initialState bool
return System.Threading.ManualResetEvent
        public static ManualResetEvent CreateManualResetEvent(bool initialState)
        {
            ManualResetEvent waitHandle = new ManualResetEvent(initialState);

            #if (WindowsCE)
            ReplaceEventHandle(waitHandle, true, initialState);
            #endif

            return waitHandle;
        }

Usage Example

コード例 #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);
 }