Exemple #1
0
 private static void EnsureTimerQueueCreated()
 {
     if (Volatile.Read(ref _timerQueue) == null)
     {
         var queue = UnmanagedMethods.CreateTimerQueue();
         if (Interlocked.CompareExchange(ref _timerQueue, queue, IntPtr.Zero) != IntPtr.Zero)
         {
             UnmanagedMethods.DeleteTimerQueueEx(queue, IntPtr.Zero);
         }
     }
 }