Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ CopyTo() [2/2]

void System.Collections.Concurrent.ConcurrentBag< T >.CopyTo ( T[] array,
int index )
inline

Implements System.Collections.Concurrent.IProducerConsumerCollection< T >.

Definition at line 545 of file ConcurrentBag.cs.

546 {
547 if (array == null)
548 {
549 throw new ArgumentNullException("array", System.SR.ConcurrentBag_CopyTo_ArgumentNullException);
550 }
551 if (index < 0)
552 {
553 throw new ArgumentOutOfRangeException("index", System.SR.Collection_CopyTo_ArgumentOutOfRangeException);
554 }
555 if (_workStealingQueues == null)
556 {
557 return;
558 }
559 bool lockTaken = false;
560 try
561 {
564 if (index > array.Length - dangerousCount)
565 {
567 }
568 try
569 {
571 }
572 catch (ArrayTypeMismatchException ex)
573 {
574 throw new InvalidCastException(ex.Message, ex);
575 }
576 }
577 finally
578 {
580 }
581 }
int CopyFromEachQueueToArray(T[] array, int index)
volatile WorkStealingQueue _workStealingQueues
static string ConcurrentBag_CopyTo_ArgumentNullException
Definition SR.cs:54
static string Collection_CopyTo_TooManyElems
Definition SR.cs:32
static string Collection_CopyTo_ArgumentOutOfRangeException
Definition SR.cs:56
Definition SR.cs:7

References System.Collections.Concurrent.ConcurrentBag< T >._workStealingQueues, System.array, System.SR.Collection_CopyTo_ArgumentOutOfRangeException, System.SR.Collection_CopyTo_TooManyElems, System.SR.ConcurrentBag_CopyTo_ArgumentNullException, System.Collections.Concurrent.ConcurrentBag< T >.CopyFromEachQueueToArray(), System.Collections.Concurrent.ConcurrentBag< T >.DangerousCount, System.Collections.Concurrent.ConcurrentBag< T >.FreezeBag(), System.index, and System.Collections.Concurrent.ConcurrentBag< T >.UnfreezeBag().

Referenced by System.Collections.Concurrent.ConcurrentBag< T >.CopyTo().