/// <exception cref="T:System.ArgumentOutOfRangeException">The count of <paramref name="collections"/> is greater than the maximum size of
/// 62 for STA and 63 for MTA.</exception>
/// <remarks>A call to TakeFromAny may block until an item is available to be removed.</remarks>
- public static int TakeFromAny(BlockingCollection<T>[] collections, [MaybeNullWhen(false)] out T item)
+ public static int TakeFromAny(BlockingCollection<T>[] collections, [MaybeNull] out T item)
{
return TakeFromAny(collections, out item, CancellationToken.None);
}
/// <exception cref="T:System.ArgumentOutOfRangeException">The count of <paramref name="collections"/> is greater than the maximum size of
/// 62 for STA and 63 for MTA.</exception>
/// <remarks>A call to TakeFromAny may block until an item is available to be removed.</remarks>
- public static int TakeFromAny(BlockingCollection<T>[] collections, [MaybeNullWhen(false)] out T item, CancellationToken cancellationToken)
+ public static int TakeFromAny(BlockingCollection<T>[] collections, [MaybeNull] out T item, CancellationToken cancellationToken)
{
int returnValue = TryTakeFromAnyCore(collections, out item, Timeout.Infinite, true, cancellationToken);
Debug.Assert((returnValue >= 0 && returnValue < collections.Length)
/// <exception cref="T:System.ArgumentOutOfRangeException">The count of <paramref name="collections"/> is greater than the maximum size of
/// 62 for STA and 63 for MTA.</exception>
/// <remarks>A call to TryTakeFromAny may block until an item is available to be removed.</remarks>
- public static int TryTakeFromAny(BlockingCollection<T>[] collections, [MaybeNullWhen(false)] out T item)
+ public static int TryTakeFromAny(BlockingCollection<T>[] collections, [MaybeNull] out T item)
{
return TryTakeFromAny(collections, out item, 0);
}
/// <exception cref="T:System.ArgumentOutOfRangeException">The count of <paramref name="collections"/> is greater than the maximum size of
/// 62 for STA and 63 for MTA.</exception>
/// <remarks>A call to TryTakeFromAny may block until an item is available to be removed.</remarks>
- public static int TryTakeFromAny(BlockingCollection<T>[] collections, [MaybeNullWhen(false)] out T item, TimeSpan timeout)
+ public static int TryTakeFromAny(BlockingCollection<T>[] collections, [MaybeNull] out T item, TimeSpan timeout)
{
ValidateTimeout(timeout);
return TryTakeFromAnyCore(collections, out item, (int)timeout.TotalMilliseconds, false, CancellationToken.None);
/// <exception cref="T:System.ArgumentOutOfRangeException">The count of <paramref name="collections"/> is greater than the maximum size of
/// 62 for STA and 63 for MTA.</exception>
/// <remarks>A call to TryTakeFromAny may block until an item is available to be removed.</remarks>
- public static int TryTakeFromAny(BlockingCollection<T>[] collections, [MaybeNullWhen(false)] out T item, int millisecondsTimeout)
+ public static int TryTakeFromAny(BlockingCollection<T>[] collections, [MaybeNull] out T item, int millisecondsTimeout)
{
ValidateMillisecondsTimeout(millisecondsTimeout);
return TryTakeFromAnyCore(collections, out item, millisecondsTimeout, false, CancellationToken.None);
/// <exception cref="T:System.ArgumentOutOfRangeException">The count of <paramref name="collections"/> is greater than the maximum size of
/// 62 for STA and 63 for MTA.</exception>
/// <remarks>A call to TryTakeFromAny may block until an item is available to be removed.</remarks>
- public static int TryTakeFromAny(BlockingCollection<T>[] collections, [MaybeNullWhen(false)] out T item, int millisecondsTimeout, CancellationToken cancellationToken)
+ public static int TryTakeFromAny(BlockingCollection<T>[] collections, [MaybeNull] out T item, int millisecondsTimeout, CancellationToken cancellationToken)
{
ValidateMillisecondsTimeout(millisecondsTimeout);
return TryTakeFromAnyCore(collections, out item, millisecondsTimeout, false, cancellationToken);
/// <exception cref="System.ArgumentException">If the collections argument is a 0-length array or contains a
/// null element. Also, if at least one of the collections has been marked complete for adds.</exception>
/// <exception cref="System.ObjectDisposedException">If at least one of the collections has been disposed.</exception>
- private static int TryTakeFromAnyCore(BlockingCollection<T>[] collections, [MaybeNullWhen(false)] out T item, int millisecondsTimeout, bool isTakeOperation, CancellationToken externalCancellationToken)
+ private static int TryTakeFromAnyCore(BlockingCollection<T>[] collections, [MaybeNull] out T item, int millisecondsTimeout, bool isTakeOperation, CancellationToken externalCancellationToken)
{
ValidateCollectionsArray(collections, false);
/// <exception cref="System.ArgumentException">If the collections argument is a 0-length array or contains a
/// null element. Also, if at least one of the collections has been marked complete for adds.</exception>
/// <exception cref="System.ObjectDisposedException">If at least one of the collections has been disposed.</exception>
- private static int TryTakeFromAnyCoreSlow(BlockingCollection<T>[] collections, [MaybeNullWhen(false)] out T item, int millisecondsTimeout, bool isTakeOperation, CancellationToken externalCancellationToken)
+ private static int TryTakeFromAnyCoreSlow(BlockingCollection<T>[] collections, [MaybeNull] out T item, int millisecondsTimeout, bool isTakeOperation, CancellationToken externalCancellationToken)
{
const int OPERATION_FAILED = -1;