Example #1
0
 public static SynchronizationContextAwaiter GetAwaiter(this SynchronizationContext context)
 {
     if (!QueueAwaiters.TryDequeue(out SynchronizationContextAwaiter awaiter))
     {
         awaiter = new SynchronizationContextAwaiter();
     }
     return(awaiter);
 }
Example #2
0
 public static void SetAwaiter(this SynchronizationContextAwaiter context)
 {
     QueueAwaiters.Enqueue(context);
 }