public static int TryTakeFromAny(BlockingCollection <T>[] collections, out T item, TimeSpan timeout) { BlockingCollection <T> .ValidateTimeout(timeout); T local = default(T); int num = BlockingCollection <T> .TryAddTakeAny(collections, ref local, (int)timeout.TotalMilliseconds, OperationMode <T> .Take, new CancellationToken()); item = local; return(num); }
public static int TryAddToAny(BlockingCollection <T>[] collections, T item, TimeSpan timeout) { BlockingCollection <T> .ValidateTimeout(timeout); return(BlockingCollection <T> .TryAddTakeAny(collections, ref item, (int)timeout.TotalMilliseconds, OperationMode <T> .Add, new CancellationToken())); }
public bool TryTake(out T item, TimeSpan timeout) { BlockingCollection <T> .ValidateTimeout(timeout); return(this.TryTakeWithNoTimeValidation(out item, (int)timeout.TotalMilliseconds, CancellationToken.None, null)); }
public bool TryAdd(T item, TimeSpan timeout) { BlockingCollection <T> .ValidateTimeout(timeout); return(this.TryAddWithNoTimeValidation(item, (int)timeout.TotalMilliseconds, new CancellationToken())); }