예제 #1
0
 internal void Wait()
 {
     CommonUtility.RunWithoutSynchronizationContext(() => ((Task)this.internalAsyncResult).Wait());
 }
예제 #2
0
 /// <summary>
 /// Checks that the given timeout in within allowed bounds.
 /// </summary>
 /// <param name="timeout">The timeout to check.</param>
 /// <exception cref="ArgumentOutOfRangeException">The timeout is not within allowed bounds.</exception>
 internal static void CheckTimeoutBounds(TimeSpan timeout)
 {
     CommonUtility.AssertInBounds("Timeout", timeout, TimeSpan.FromSeconds(1), Constants.MaximumAllowedTimeout);
 }
예제 #3
0
 public AsyncSemaphoreAsync(int initialCount)
 {
     CommonUtility.AssertInBounds("initialCount", initialCount, 0, int.MaxValue);
     this.count = initialCount;
 }