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

◆ ConcurrentDictionary() [8/8]

System.Collections.Concurrent.ConcurrentDictionary< TKey, TValue >.ConcurrentDictionary ( int concurrencyLevel,
int capacity,
bool growLockArray,
IEqualityComparer< TKey > comparer )
inlinepackage

Definition at line 396 of file ConcurrentDictionary.cs.

397 {
398 if (concurrencyLevel < 1)
399 {
400 throw new ArgumentOutOfRangeException("concurrencyLevel", System.SR.ConcurrentDictionary_ConcurrencyLevelMustBePositive);
401 }
402 if (capacity < 0)
403 {
404 throw new ArgumentOutOfRangeException("capacity", System.SR.ConcurrentDictionary_CapacityMustNotBeNegative);
405 }
407 {
409 }
410 object[] array = new object[concurrencyLevel];
411 array[0] = array;
412 for (int i = 1; i < array.Length; i++)
413 {
414 array[i] = new object();
415 }
416 int[] countPerLock = new int[array.Length];
417 Node[] array2 = new Node[capacity];
420 if (comparer != null && comparer != _defaultComparer && comparer != StringComparer.Ordinal)
421 {
423 }
425 _budget = array2.Length / array.Length;
426 }
static string ConcurrentDictionary_ConcurrencyLevelMustBePositive
Definition SR.cs:64
static string ConcurrentDictionary_CapacityMustNotBeNegative
Definition SR.cs:66
Definition SR.cs:7

References System.Collections.Concurrent.ConcurrentDictionary< TKey, TValue >._budget, System.Collections.Concurrent.ConcurrentDictionary< TKey, TValue >._comparer, System.Collections.Concurrent.ConcurrentDictionary< TKey, TValue >._defaultComparer, System.Collections.Concurrent.ConcurrentDictionary< TKey, TValue >._growLockArray, System.Collections.Concurrent.ConcurrentDictionary< TKey, TValue >._tables, System.array, System.capacity, System.comparer, System.SR.ConcurrentDictionary_CapacityMustNotBeNegative, System.SR.ConcurrentDictionary_ConcurrencyLevelMustBePositive, and System.StringComparer.Ordinal.