59 references to EnsureInitialized
Microsoft.CodeAnalysis (7)
InternalUtilities\RoslynLazyInitializer.cs (2)
17/// <inheritdoc cref="LazyInitializer.EnsureInitialized{T}(ref T, Func{T})"/> 19=> LazyInitializer.EnsureInitialized<T>(ref target!, valueFactory);
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (3)
393return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedDictionary<TKey, TValue>(), Enumerator.KeyValuePair))!; 1362return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedDictionary<TKey, TValue>()))!; 1570return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedDictionary<TKey, TValue>()))!;
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (1)
374return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedHashSet<T>()))!;
src\Dependencies\Collections\Segmented\SegmentedList`1.cs (1)
742return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedList<T>(0)))!;
Microsoft.CodeAnalysis.CodeStyle (5)
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (3)
393return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedDictionary<TKey, TValue>(), Enumerator.KeyValuePair))!; 1362return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedDictionary<TKey, TValue>()))!; 1570return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedDictionary<TKey, TValue>()))!;
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (1)
374return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedHashSet<T>()))!;
src\Dependencies\Collections\Segmented\SegmentedList`1.cs (1)
742return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedList<T>(0)))!;
Microsoft.CodeAnalysis.Collections.Package (5)
Segmented\SegmentedDictionary`2.cs (3)
393return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedDictionary<TKey, TValue>(), Enumerator.KeyValuePair))!; 1362return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedDictionary<TKey, TValue>()))!; 1570return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedDictionary<TKey, TValue>()))!;
Segmented\SegmentedHashSet`1.cs (1)
374return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedHashSet<T>()))!;
Segmented\SegmentedList`1.cs (1)
742return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedList<T>(0)))!;
Microsoft.CodeAnalysis.CSharp (1)
Symbols\Retargeting\RetargetingAssemblySymbol.cs (1)
81LazyInitializer.EnsureInitialized(ref _noPiaUnificationMap, () => new ConcurrentDictionary<NamedTypeSymbol, NamedTypeSymbol>(concurrencyLevel: 2, capacity: 0));
Microsoft.CodeAnalysis.InteractiveHost (5)
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (3)
393return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedDictionary<TKey, TValue>(), Enumerator.KeyValuePair))!; 1362return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedDictionary<TKey, TValue>()))!; 1570return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedDictionary<TKey, TValue>()))!;
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (1)
374return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedHashSet<T>()))!;
src\Dependencies\Collections\Segmented\SegmentedList`1.cs (1)
742return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedList<T>(0)))!;
Microsoft.CodeAnalysis.Threading.Package (5)
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (3)
393return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedDictionary<TKey, TValue>(), Enumerator.KeyValuePair))!; 1362return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedDictionary<TKey, TValue>()))!; 1570return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedDictionary<TKey, TValue>()))!;
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (1)
374return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedHashSet<T>()))!;
src\Dependencies\Collections\Segmented\SegmentedList`1.cs (1)
742return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedList<T>(0)))!;
Microsoft.CodeAnalysis.Workspaces (5)
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (3)
393return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedDictionary<TKey, TValue>(), Enumerator.KeyValuePair))!; 1362return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedDictionary<TKey, TValue>()))!; 1570return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedDictionary<TKey, TValue>()))!;
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (1)
374return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedHashSet<T>()))!;
src\Dependencies\Collections\Segmented\SegmentedList`1.cs (1)
742return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedList<T>(0)))!;
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (7)
src\Compilers\Core\Portable\InternalUtilities\RoslynLazyInitializer.cs (2)
17/// <inheritdoc cref="LazyInitializer.EnsureInitialized{T}(ref T, Func{T})"/> 19=> LazyInitializer.EnsureInitialized<T>(ref target!, valueFactory);
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (3)
393return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedDictionary<TKey, TValue>(), Enumerator.KeyValuePair))!; 1362return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedDictionary<TKey, TValue>()))!; 1570return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedDictionary<TKey, TValue>()))!;
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (1)
374return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedHashSet<T>()))!;
src\Dependencies\Collections\Segmented\SegmentedList`1.cs (1)
742return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedList<T>(0)))!;
Microsoft.Extensions.Logging.EventSource (1)
LoggingEventSource.cs (1)
388CancellationTokenSource cts = LazyInitializer.EnsureInitialized(ref _cancellationTokenSource, () => new CancellationTokenSource());
System.ComponentModel.TypeConverter (7)
System\ComponentModel\ReflectTypeDescriptionProvider.cs (6)
94private static Hashtable EditorTables => LazyInitializer.EnsureInitialized(ref s_editorTables, () => new Hashtable(4)); 149return LazyInitializer.EnsureInitialized(ref s_intrinsicTypeConverters, () => new Dictionary<object, IntrinsicTypeConverterData>(32) 196private static Hashtable PropertyCache => LazyInitializer.EnsureInitialized(ref s_propertyCache, () => new Hashtable()); 198private static Hashtable EventCache => LazyInitializer.EnsureInitialized(ref s_eventCache, () => new Hashtable()); 200private static Hashtable AttributeCache => LazyInitializer.EnsureInitialized(ref s_attributeCache, () => new Hashtable()); 202private static Hashtable ExtendedPropertyCache => LazyInitializer.EnsureInitialized(ref s_extendedPropertyCache, () => new Hashtable());
System\ComponentModel\TypeDescriptor.cs (1)
147private static WeakHashtable AssociationTable => LazyInitializer.EnsureInitialized(ref s_associationTable, () => new WeakHashtable());
System.IO.Pipes (1)
System\IO\Pipes\PipeStream.Unix.cs (1)
435return LazyInitializer.EnsureInitialized(ref _asyncActiveSemaphore, () => new SemaphoreSlim(1, 1));
System.Net.Http (3)
System\Net\Http\DiagnosticsHelper.cs (2)
89object[] boxes = LazyInitializer.EnsureInitialized(ref s_boxedStatusCodes, static () => new object[512]); 101string[] strings = LazyInitializer.EnsureInitialized(ref s_statusCodeStrings, static () => new string[200]);
System\Net\Http\HttpClient.cs (1)
41get => LazyInitializer.EnsureInitialized(ref s_defaultProxy, () => SystemProxyInfo.Proxy);
System.Net.Sockets (1)
System\Net\Sockets\SocketAsyncEventArgs.cs (1)
320LazyInitializer.EnsureInitialized(ref s_connectActivityTable, () => new ConditionalWeakTable<SocketAsyncEventArgs, Activity>());
System.Security.Cryptography (1)
System\Security\Cryptography\CryptoStream.cs (1)
853return LazyInitializer.EnsureInitialized(ref _lazyAsyncActiveSemaphore, () => new SemaphoreSlim(1, 1));
System.Threading.Tasks.Dataflow (3)
Base\DataflowBlock.cs (1)
2633get { return LazyInitializer.EnsureInitialized(ref _completion, static () => new TaskCompletionSource<VoidResult>().Task); }
Internal\SpscTargetCore.cs (2)
312lock (LazyInitializer.EnsureInitialized(ref _exceptions, static () => new List<Exception>())) 360get { return LazyInitializer.EnsureInitialized(ref _completionTask, static () => new TaskCompletionSource<VoidResult>()); }
System.Threading.Tasks.Parallel (2)
System\Threading\Tasks\Parallel.cs (2)
282LazyInitializer.EnsureInitialized<ConcurrentQueue<Exception>>(ref exceptionQ, () => { return new ConcurrentQueue<Exception>(); }); 298LazyInitializer.EnsureInitialized<ConcurrentQueue<Exception>>(ref exceptionQ, () => { return new ConcurrentQueue<Exception>(); });