76 references to EnsureInitialized
GenerateDocumentationAndConfigFiles (5)
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (3)
395return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedDictionary<TKey, TValue>(), Enumerator.KeyValuePair))!; 1364return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedDictionary<TKey, TValue>()))!; 1572return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedDictionary<TKey, TValue>()))!;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (1)
376return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedHashSet<T>()))!;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedList`1.cs (1)
744return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedList<T>(0)))!;
Microsoft.Build (5)
src\5057ed6cf5d6323b\SegmentedDictionary`2.cs (3)
395return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedDictionary<TKey, TValue>(), Enumerator.KeyValuePair))!; 1364return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedDictionary<TKey, TValue>()))!; 1572return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedDictionary<TKey, TValue>()))!;
src\msbuild\artifacts\.packages\microsoft.codeanalysis.collections\5.0.0-1.25277.114\contentFiles\cs\net9.0\Segmented\SegmentedHashSet`1.cs (1)
376return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedHashSet<T>()))!;
src\msbuild\artifacts\.packages\microsoft.codeanalysis.collections\5.0.0-1.25277.114\contentFiles\cs\net9.0\Segmented\SegmentedList`1.cs (1)
744return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedList<T>(0)))!;
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\roslyn\src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (3)
395return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedDictionary<TKey, TValue>(), Enumerator.KeyValuePair))!; 1364return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedDictionary<TKey, TValue>()))!; 1572return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedDictionary<TKey, TValue>()))!;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (1)
376return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedHashSet<T>()))!;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedList`1.cs (1)
744return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedList<T>(0)))!;
Microsoft.CodeAnalysis.Analyzers (5)
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (3)
395return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedDictionary<TKey, TValue>(), Enumerator.KeyValuePair))!; 1364return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedDictionary<TKey, TValue>()))!; 1572return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedDictionary<TKey, TValue>()))!;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (1)
376return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedHashSet<T>()))!;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedList`1.cs (1)
744return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedList<T>(0)))!;
Microsoft.CodeAnalysis.AnalyzerUtilities (5)
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (3)
395return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedDictionary<TKey, TValue>(), Enumerator.KeyValuePair))!; 1364return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedDictionary<TKey, TValue>()))!; 1572return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedDictionary<TKey, TValue>()))!;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (1)
376return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedHashSet<T>()))!;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedList`1.cs (1)
744return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedList<T>(0)))!;
Microsoft.CodeAnalysis.CodeStyle (5)
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (3)
395return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedDictionary<TKey, TValue>(), Enumerator.KeyValuePair))!; 1364return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedDictionary<TKey, TValue>()))!; 1572return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedDictionary<TKey, TValue>()))!;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (1)
376return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedHashSet<T>()))!;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedList`1.cs (1)
744return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedList<T>(0)))!;
Microsoft.CodeAnalysis.CSharp (2)
Compilation\CSharpCompilation.cs (1)
2560var dictionary = LazyInitializer.EnsureInitialized(ref _interceptions,
Symbols\Retargeting\RetargetingAssemblySymbol.cs (1)
81LazyInitializer.EnsureInitialized(ref _noPiaUnificationMap, () => new ConcurrentDictionary<NamedTypeSymbol, NamedTypeSymbol>(concurrencyLevel: 2, capacity: 0));
Microsoft.CodeAnalysis.CSharp.NetAnalyzers (1)
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler.CSharp\Lightup\AwaitExpressionInfoWrapper.cs (1)
19LazyInitializer.EnsureInitialized(ref s_RuntimeAwaitMethodAccessor, () =>
Microsoft.CodeAnalysis.Extensions.Package (5)
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (3)
395return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedDictionary<TKey, TValue>(), Enumerator.KeyValuePair))!; 1364return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedDictionary<TKey, TValue>()))!; 1572return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedDictionary<TKey, TValue>()))!;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (1)
376return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedHashSet<T>()))!;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedList`1.cs (1)
744return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedList<T>(0)))!;
Microsoft.CodeAnalysis.NetAnalyzers (1)
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\WellKnownTypeProvider.cs (1)
87var getTypesCache = LazyInitializer.EnsureInitialized(
Microsoft.CodeAnalysis.ResxSourceGenerator (5)
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (3)
395return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedDictionary<TKey, TValue>(), Enumerator.KeyValuePair))!; 1364return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedDictionary<TKey, TValue>()))!; 1572return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedDictionary<TKey, TValue>()))!;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (1)
376return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedHashSet<T>()))!;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedList`1.cs (1)
744return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedList<T>(0)))!;
Microsoft.CodeAnalysis.Workspaces (5)
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (3)
395return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedDictionary<TKey, TValue>(), Enumerator.KeyValuePair))!; 1364return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedDictionary<TKey, TValue>()))!; 1572return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedDictionary<TKey, TValue>()))!;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (1)
376return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedHashSet<T>()))!;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedList`1.cs (1)
744return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedList<T>(0)))!;
Microsoft.Extensions.Logging.EventSource (1)
LoggingEventSource.cs (1)
401CancellationTokenSource cts = LazyInitializer.EnsureInitialized(ref _cancellationTokenSource, () => new CancellationTokenSource());
NuGet.Packaging (1)
Signing\DerEncoding\DerSequenceReader.cs (1)
489DateTimeFormatInfo fi = LazyInitializer.EnsureInitialized(
Roslyn.Diagnostics.Analyzers (5)
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (3)
395return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedDictionary<TKey, TValue>(), Enumerator.KeyValuePair))!; 1364return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedDictionary<TKey, TValue>()))!; 1572return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedDictionary<TKey, TValue>()))!;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (1)
376return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedHashSet<T>()))!;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedList`1.cs (1)
744return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedList<T>(0)))!;
System.ComponentModel.TypeConverter (7)
System\ComponentModel\ReflectTypeDescriptionProvider.cs (6)
93private static Hashtable EditorTables => LazyInitializer.EnsureInitialized(ref s_editorTables, () => new Hashtable(4)); 148return LazyInitializer.EnsureInitialized(ref s_intrinsicTypeConverters, () => new Dictionary<object, IntrinsicTypeConverterData>(32) 195private static CollectibleKeyHashtable PropertyCache => LazyInitializer.EnsureInitialized(ref s_propertyCache, () => new CollectibleKeyHashtable()); 197private static CollectibleKeyHashtable EventCache => LazyInitializer.EnsureInitialized(ref s_eventCache, () => new CollectibleKeyHashtable()); 199private static CollectibleKeyHashtable AttributeCache => LazyInitializer.EnsureInitialized(ref s_attributeCache, () => new CollectibleKeyHashtable()); 201private static CollectibleKeyHashtable ExtendedPropertyCache => LazyInitializer.EnsureInitialized(ref s_extendedPropertyCache, () => new CollectibleKeyHashtable());
System\ComponentModel\TypeDescriptor.cs (1)
156private 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)
104object[] boxes = LazyInitializer.EnsureInitialized(ref s_boxedStatusCodes, static () => new object[512]); 116string[] 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)
2635get { 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)
279LazyInitializer.EnsureInitialized<ConcurrentQueue<Exception>>(ref exceptionQ, () => { return new ConcurrentQueue<Exception>(); }); 295LazyInitializer.EnsureInitialized<ConcurrentQueue<Exception>>(ref exceptionQ, () => { return new ConcurrentQueue<Exception>(); });