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