/// <summary> /// Cancellation handler for CancellationToken /// </summary> /// <param name="obj">SemaphoreLight object</param> private static void CancellationTokenCanceledEventHandler(object obj) { SemaphoreLight semaphore = obj as SemaphoreLight; TurboContract.Assert(semaphore != null, conditionString: "semaphore != null"); lock (semaphore._lockObj) { Monitor.PulseAll(semaphore._lockObj); } }
/// <summary> /// Cancellation handler for CancellationToken /// </summary> /// <param name="obj">SemaphoreLight object</param> private static void CancellationTokenCanceledEventHandler(object obj) { SemaphoreLight semaphore = obj as SemaphoreLight; Debug.Assert(semaphore != null); lock (semaphore._lockObj) { Monitor.PulseAll(semaphore._lockObj); } }