262 references to LazyThreadSafetyMode
dotnet-svcutil-lib (1)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpChannelFactory.cs (1)
109
_webSocketSoapContentType = new Lazy<string>(() => MessageEncoderFactory.CreateSessionEncoder().ContentType,
LazyThreadSafetyMode
.ExecutionAndPublication);
GenerateDocumentationAndConfigFiles (1)
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (1)
41
LazyThreadSafetyMode
.ExecutionAndPublication);
Metrics (1)
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (1)
41
LazyThreadSafetyMode
.ExecutionAndPublication);
Metrics.Legacy (1)
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (1)
41
LazyThreadSafetyMode
.ExecutionAndPublication);
Microsoft.AspNetCore.App.Analyzers.Test (1)
TestDiagnosticAnalyzer.cs (1)
136
LazyThreadSafetyMode
.ExecutionAndPublication);
Microsoft.AspNetCore.Grpc.JsonTranscoding (2)
GrpcJsonTranscodingOptions.cs (2)
23
LazyThreadSafetyMode
.ExecutionAndPublication);
26
LazyThreadSafetyMode
.ExecutionAndPublication);
Microsoft.Build (3)
BackEnd\Components\Logging\LoggingService.cs (3)
98
private static readonly Lazy<PropertyInfo> s_projectStartedEventArgsGlobalProperties = new Lazy<PropertyInfo>(() => typeof(ProjectStartedEventArgs).GetProperty("GlobalProperties", BindingFlags.Public | BindingFlags.Instance),
LazyThreadSafetyMode
.PublicationOnly);
107
private static readonly Lazy<PropertyInfo> s_projectStartedEventArgsToolsVersion = new Lazy<PropertyInfo>(() => typeof(ProjectStartedEventArgs).GetProperty("ToolsVersion", BindingFlags.Public | BindingFlags.Instance),
LazyThreadSafetyMode
.PublicationOnly);
317
_configCache = new Lazy<IConfigCache>(() => (IConfigCache)_componentHost.GetComponent(BuildComponentType.ConfigCache),
LazyThreadSafetyMode
.PublicationOnly);
Microsoft.Build.Framework (1)
FileUtilities_TempFiles.cs (1)
31
LazyThreadSafetyMode
.ExecutionAndPublication);
Microsoft.Build.Tasks.Core (1)
WriteCodeFragment.cs (1)
280
System.Threading.
LazyThreadSafetyMode
.None);
Microsoft.CodeAnalysis.Analyzers (1)
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (1)
41
LazyThreadSafetyMode
.ExecutionAndPublication);
Microsoft.CodeAnalysis.AnalyzerUtilities (4)
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (1)
41
LazyThreadSafetyMode
.ExecutionAndPublication);
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\TaintedDataAnalysis\TaintedDataConfig.cs (3)
121
LazyThreadSafetyMode
.ExecutionAndPublication);
132
LazyThreadSafetyMode
.ExecutionAndPublication);
154
LazyThreadSafetyMode
.ExecutionAndPublication);
Microsoft.CodeAnalysis.BannedApiAnalyzers (1)
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (1)
41
LazyThreadSafetyMode
.ExecutionAndPublication);
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (1)
ObjectFormatterTests.cs (1)
754
var obj = new Lazy<int[]>(() => new int[] { 1, 2 },
LazyThreadSafetyMode
.None);
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (1)
Diagnostics\SuppressMessageAttributeWorkspaceTests.cs (1)
51
},
LazyThreadSafetyMode
.PublicationOnly);
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (1)
ExpressionCompiler.cs (1)
381
new Lazy<ImmutableArray<AssemblyReaders>>(instructionAddress.MakeAssemblyReaders,
LazyThreadSafetyMode
.None),
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider.Utilities (1)
Debugger\Engine\DkmClrType.cs (1)
49
LazyThreadSafetyMode
.PublicationOnly);
Microsoft.CodeAnalysis.Features (2)
Completion\CompletionList.cs (1)
83
_lazyItems = new(() => ItemsList.ToImmutableArrayOrEmpty(), System.Threading.
LazyThreadSafetyMode
.PublicationOnly);
Completion\CompletionService.ProviderManager.cs (1)
40
_nameToProvider = new Lazy<ImmutableDictionary<string, CompletionProvider>>(LoadImportedProvidersAndCreateNameMap,
LazyThreadSafetyMode
.PublicationOnly);
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (1)
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (1)
41
LazyThreadSafetyMode
.ExecutionAndPublication);
Microsoft.CodeAnalysis.PublicApiAnalyzers (1)
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (1)
41
LazyThreadSafetyMode
.ExecutionAndPublication);
Microsoft.CodeAnalysis.ResxSourceGenerator (1)
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (1)
41
LazyThreadSafetyMode
.ExecutionAndPublication);
Microsoft.CodeAnalysis.Test.Utilities (177)
Mocks\Silverlight.cs (1)
31
LazyThreadSafetyMode
.PublicationOnly);
Mocks\TestReferences.cs (147)
23
LazyThreadSafetyMode
.PublicationOnly);
28
LazyThreadSafetyMode
.PublicationOnly);
33
LazyThreadSafetyMode
.PublicationOnly);
38
LazyThreadSafetyMode
.PublicationOnly);
46
LazyThreadSafetyMode
.PublicationOnly);
51
LazyThreadSafetyMode
.PublicationOnly);
56
LazyThreadSafetyMode
.PublicationOnly);
61
LazyThreadSafetyMode
.PublicationOnly);
66
LazyThreadSafetyMode
.PublicationOnly);
77
LazyThreadSafetyMode
.PublicationOnly);
82
LazyThreadSafetyMode
.PublicationOnly);
87
LazyThreadSafetyMode
.PublicationOnly);
95
LazyThreadSafetyMode
.PublicationOnly);
103
LazyThreadSafetyMode
.PublicationOnly);
114
LazyThreadSafetyMode
.PublicationOnly);
122
LazyThreadSafetyMode
.PublicationOnly);
130
LazyThreadSafetyMode
.PublicationOnly);
138
LazyThreadSafetyMode
.PublicationOnly);
146
LazyThreadSafetyMode
.PublicationOnly);
154
LazyThreadSafetyMode
.PublicationOnly);
163
LazyThreadSafetyMode
.PublicationOnly);
168
LazyThreadSafetyMode
.PublicationOnly);
173
LazyThreadSafetyMode
.PublicationOnly);
178
LazyThreadSafetyMode
.PublicationOnly);
183
LazyThreadSafetyMode
.PublicationOnly);
188
LazyThreadSafetyMode
.PublicationOnly);
193
LazyThreadSafetyMode
.PublicationOnly);
198
LazyThreadSafetyMode
.PublicationOnly);
203
LazyThreadSafetyMode
.PublicationOnly);
208
LazyThreadSafetyMode
.PublicationOnly);
213
LazyThreadSafetyMode
.PublicationOnly);
220
LazyThreadSafetyMode
.PublicationOnly);
225
LazyThreadSafetyMode
.PublicationOnly);
230
LazyThreadSafetyMode
.PublicationOnly);
235
LazyThreadSafetyMode
.PublicationOnly);
243
LazyThreadSafetyMode
.PublicationOnly);
248
LazyThreadSafetyMode
.PublicationOnly);
253
LazyThreadSafetyMode
.PublicationOnly);
263
LazyThreadSafetyMode
.PublicationOnly);
271
LazyThreadSafetyMode
.PublicationOnly);
279
LazyThreadSafetyMode
.PublicationOnly);
287
LazyThreadSafetyMode
.PublicationOnly);
298
LazyThreadSafetyMode
.PublicationOnly);
306
LazyThreadSafetyMode
.PublicationOnly);
314
LazyThreadSafetyMode
.PublicationOnly);
322
LazyThreadSafetyMode
.PublicationOnly);
333
LazyThreadSafetyMode
.PublicationOnly);
341
LazyThreadSafetyMode
.PublicationOnly);
349
LazyThreadSafetyMode
.PublicationOnly);
357
LazyThreadSafetyMode
.PublicationOnly);
369
LazyThreadSafetyMode
.PublicationOnly);
374
LazyThreadSafetyMode
.PublicationOnly);
379
LazyThreadSafetyMode
.PublicationOnly);
384
LazyThreadSafetyMode
.PublicationOnly);
392
LazyThreadSafetyMode
.PublicationOnly);
397
LazyThreadSafetyMode
.PublicationOnly);
402
LazyThreadSafetyMode
.PublicationOnly);
407
LazyThreadSafetyMode
.PublicationOnly);
417
LazyThreadSafetyMode
.PublicationOnly);
423
LazyThreadSafetyMode
.PublicationOnly);
430
LazyThreadSafetyMode
.PublicationOnly);
441
LazyThreadSafetyMode
.PublicationOnly);
446
LazyThreadSafetyMode
.PublicationOnly);
452
LazyThreadSafetyMode
.PublicationOnly);
459
LazyThreadSafetyMode
.PublicationOnly);
467
LazyThreadSafetyMode
.PublicationOnly);
478
LazyThreadSafetyMode
.PublicationOnly);
486
LazyThreadSafetyMode
.PublicationOnly);
495
LazyThreadSafetyMode
.PublicationOnly);
500
LazyThreadSafetyMode
.PublicationOnly);
505
LazyThreadSafetyMode
.PublicationOnly);
511
LazyThreadSafetyMode
.PublicationOnly);
522
LazyThreadSafetyMode
.PublicationOnly);
530
LazyThreadSafetyMode
.PublicationOnly);
541
LazyThreadSafetyMode
.PublicationOnly);
549
LazyThreadSafetyMode
.PublicationOnly);
559
LazyThreadSafetyMode
.PublicationOnly);
564
LazyThreadSafetyMode
.PublicationOnly);
569
LazyThreadSafetyMode
.PublicationOnly);
574
LazyThreadSafetyMode
.PublicationOnly);
584
LazyThreadSafetyMode
.PublicationOnly);
592
LazyThreadSafetyMode
.PublicationOnly);
598
LazyThreadSafetyMode
.PublicationOnly);
606
LazyThreadSafetyMode
.PublicationOnly);
611
LazyThreadSafetyMode
.PublicationOnly);
616
LazyThreadSafetyMode
.PublicationOnly);
621
LazyThreadSafetyMode
.PublicationOnly);
626
LazyThreadSafetyMode
.PublicationOnly);
631
LazyThreadSafetyMode
.PublicationOnly);
641
LazyThreadSafetyMode
.PublicationOnly);
649
LazyThreadSafetyMode
.PublicationOnly);
657
LazyThreadSafetyMode
.PublicationOnly);
666
LazyThreadSafetyMode
.PublicationOnly);
671
LazyThreadSafetyMode
.PublicationOnly);
676
LazyThreadSafetyMode
.PublicationOnly);
681
LazyThreadSafetyMode
.PublicationOnly);
686
LazyThreadSafetyMode
.PublicationOnly);
693
() => StdOle.Build(NetFramework.References),
LazyThreadSafetyMode
.PublicationOnly);
697
() => StdOle.Build(Net40.References.All),
LazyThreadSafetyMode
.PublicationOnly);
702
LazyThreadSafetyMode
.PublicationOnly);
707
LazyThreadSafetyMode
.PublicationOnly);
712
LazyThreadSafetyMode
.PublicationOnly);
717
LazyThreadSafetyMode
.PublicationOnly);
722
LazyThreadSafetyMode
.PublicationOnly);
727
LazyThreadSafetyMode
.PublicationOnly);
732
LazyThreadSafetyMode
.PublicationOnly);
737
LazyThreadSafetyMode
.PublicationOnly);
742
LazyThreadSafetyMode
.PublicationOnly);
747
LazyThreadSafetyMode
.PublicationOnly);
752
LazyThreadSafetyMode
.PublicationOnly);
757
LazyThreadSafetyMode
.PublicationOnly);
762
LazyThreadSafetyMode
.PublicationOnly);
767
LazyThreadSafetyMode
.PublicationOnly);
772
LazyThreadSafetyMode
.PublicationOnly);
777
LazyThreadSafetyMode
.PublicationOnly);
782
LazyThreadSafetyMode
.PublicationOnly);
787
LazyThreadSafetyMode
.PublicationOnly);
792
LazyThreadSafetyMode
.PublicationOnly);
801
LazyThreadSafetyMode
.PublicationOnly);
811
LazyThreadSafetyMode
.PublicationOnly);
816
LazyThreadSafetyMode
.PublicationOnly);
824
LazyThreadSafetyMode
.PublicationOnly);
829
LazyThreadSafetyMode
.PublicationOnly);
839
LazyThreadSafetyMode
.PublicationOnly);
844
LazyThreadSafetyMode
.PublicationOnly);
852
LazyThreadSafetyMode
.PublicationOnly);
857
LazyThreadSafetyMode
.PublicationOnly);
865
LazyThreadSafetyMode
.PublicationOnly);
872
LazyThreadSafetyMode
.PublicationOnly);
879
LazyThreadSafetyMode
.PublicationOnly);
887
LazyThreadSafetyMode
.PublicationOnly);
892
LazyThreadSafetyMode
.PublicationOnly);
900
LazyThreadSafetyMode
.PublicationOnly);
905
LazyThreadSafetyMode
.PublicationOnly);
910
LazyThreadSafetyMode
.PublicationOnly);
915
LazyThreadSafetyMode
.PublicationOnly);
920
LazyThreadSafetyMode
.PublicationOnly);
925
LazyThreadSafetyMode
.PublicationOnly);
930
LazyThreadSafetyMode
.PublicationOnly);
935
LazyThreadSafetyMode
.PublicationOnly);
943
LazyThreadSafetyMode
.PublicationOnly);
948
LazyThreadSafetyMode
.PublicationOnly);
953
LazyThreadSafetyMode
.PublicationOnly);
961
LazyThreadSafetyMode
.PublicationOnly);
966
LazyThreadSafetyMode
.PublicationOnly);
971
LazyThreadSafetyMode
.PublicationOnly);
976
LazyThreadSafetyMode
.PublicationOnly);
TestBase.cs (29)
80
LazyThreadSafetyMode
.PublicationOnly);
85
LazyThreadSafetyMode
.PublicationOnly);
123
LazyThreadSafetyMode
.PublicationOnly);
131
LazyThreadSafetyMode
.PublicationOnly);
147
LazyThreadSafetyMode
.PublicationOnly);
152
LazyThreadSafetyMode
.PublicationOnly);
157
LazyThreadSafetyMode
.PublicationOnly);
162
LazyThreadSafetyMode
.PublicationOnly);
167
LazyThreadSafetyMode
.PublicationOnly);
172
LazyThreadSafetyMode
.PublicationOnly);
177
LazyThreadSafetyMode
.PublicationOnly);
182
LazyThreadSafetyMode
.PublicationOnly);
205
LazyThreadSafetyMode
.PublicationOnly);
214
LazyThreadSafetyMode
.PublicationOnly);
244
LazyThreadSafetyMode
.PublicationOnly);
249
LazyThreadSafetyMode
.PublicationOnly);
255
LazyThreadSafetyMode
.PublicationOnly);
260
LazyThreadSafetyMode
.PublicationOnly);
265
LazyThreadSafetyMode
.PublicationOnly);
270
LazyThreadSafetyMode
.PublicationOnly);
275
LazyThreadSafetyMode
.PublicationOnly);
280
LazyThreadSafetyMode
.PublicationOnly);
285
LazyThreadSafetyMode
.PublicationOnly);
290
LazyThreadSafetyMode
.PublicationOnly);
295
LazyThreadSafetyMode
.PublicationOnly);
300
LazyThreadSafetyMode
.PublicationOnly);
305
LazyThreadSafetyMode
.PublicationOnly);
310
LazyThreadSafetyMode
.PublicationOnly);
315
LazyThreadSafetyMode
.PublicationOnly);
Microsoft.CodeAnalysis.UnitTests (1)
Diagnostics\SuppressMessageAttributeCompilerTests.cs (1)
65
}, System.Threading.
LazyThreadSafetyMode
.PublicationOnly);
Microsoft.Extensions.Diagnostics.ResourceMonitoring (1)
Windows\WindowsContainerResourceQuotaProvider.cs (1)
28
LazyThreadSafetyMode
.ExecutionAndPublication);
Microsoft.Extensions.Http (2)
DefaultHttpClientFactory.cs (2)
85
},
LazyThreadSafetyMode
.ExecutionAndPublication);
100
LazyThreadSafetyMode
.ExecutionAndPublication);
Microsoft.ML.Data (1)
Transforms\ColumnBindingsBase.cs (1)
344
_convertedSchema = new Lazy<DataViewSchema>(() => CreateSchema(this),
LazyThreadSafetyMode
.PublicationOnly);
Microsoft.VisualStudio.LanguageServices (1)
ProjectSystem\MetadataReferences\VisualStudioPortableExecutableReference.cs (1)
68
},
LazyThreadSafetyMode
.PublicationOnly);
mscorlib (1)
src\libraries\shims\mscorlib\ref\mscorlib.cs (1)
1135
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.
LazyThreadSafetyMode
))]
netstandard (1)
netstandard.cs (1)
2084
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.
LazyThreadSafetyMode
))]
Roslyn.Diagnostics.Analyzers (1)
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (1)
41
LazyThreadSafetyMode
.ExecutionAndPublication);
System.ComponentModel.Composition (13)
System\ComponentModel\Composition\AttributedModel\AttributedPartCreationInfo.cs (1)
44
return new Lazy<Type>(GetPartType,
LazyThreadSafetyMode
.PublicationOnly);
System\ComponentModel\Composition\ExportServices.cs (6)
81
LazyThreadSafetyMode
.PublicationOnly);
88
LazyThreadSafetyMode
.PublicationOnly);
99
LazyThreadSafetyMode
.PublicationOnly);
103
return new Lazy<T>(() => ExportServices.GetCastedExportedValue<T>(export),
LazyThreadSafetyMode
.PublicationOnly);
115
LazyThreadSafetyMode
.PublicationOnly);
122
LazyThreadSafetyMode
.PublicationOnly);
System\ComponentModel\Composition\ExportServices.DisposableLazy.cs (2)
14
public DisposableLazy(Func<T> valueFactory, TMetadataView metadataView, IDisposable disposable,
LazyThreadSafetyMode
mode)
32
public DisposableLazy(Func<T> valueFactory, IDisposable disposable,
LazyThreadSafetyMode
mode)
System\ComponentModel\Composition\Hosting\ComposablePartCatalogCollection.cs (3)
49
var addedParts = new Lazy<IEnumerable<ComposablePartDefinition>>(() => item.ToArray(),
LazyThreadSafetyMode
.PublicationOnly);
103
var removedParts = new Lazy<IEnumerable<ComposablePartDefinition>>(() => catalogs.SelectMany(catalog => catalog).ToArray(),
LazyThreadSafetyMode
.PublicationOnly);
187
var removedParts = new Lazy<IEnumerable<ComposablePartDefinition>>(() => item.ToArray(),
LazyThreadSafetyMode
.PublicationOnly);
System\ComponentModel\Composition\ReflectionModel\GenericSpecializationPartCreationInfo.cs (1)
48
LazyThreadSafetyMode
.PublicationOnly);
System.Core (1)
System.Core.cs (1)
241
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.
LazyThreadSafetyMode
))]
System.Private.CoreLib (31)
src\libraries\System.Private.CoreLib\src\System\Lazy.cs (29)
66
internal LazyHelper(
LazyThreadSafetyMode
mode, Exception exception)
70
case
LazyThreadSafetyMode
.ExecutionAndPublication:
74
case
LazyThreadSafetyMode
.None:
78
case
LazyThreadSafetyMode
.PublicationOnly:
98
private
LazyThreadSafetyMode
GetMode()
105
return
LazyThreadSafetyMode
.None;
111
return
LazyThreadSafetyMode
.PublicationOnly;
116
return
LazyThreadSafetyMode
.ExecutionAndPublication;
124
internal static
LazyThreadSafetyMode
? GetMode(LazyHelper? state)
133
internal static LazyHelper Create(
LazyThreadSafetyMode
mode, bool useDefaultConstructor)
137
case
LazyThreadSafetyMode
.None:
140
case
LazyThreadSafetyMode
.PublicationOnly:
143
case
LazyThreadSafetyMode
.ExecutionAndPublication:
167
internal static
LazyThreadSafetyMode
GetModeFromIsThreadSafe(bool isThreadSafe)
169
return isThreadSafe ?
LazyThreadSafetyMode
.ExecutionAndPublication :
LazyThreadSafetyMode
.None;
208
: this(null,
LazyThreadSafetyMode
.ExecutionAndPublication, useDefaultConstructor: true)
239
: this(valueFactory,
LazyThreadSafetyMode
.ExecutionAndPublication, useDefaultConstructor: false)
260
public Lazy(
LazyThreadSafetyMode
mode) :
292
public Lazy(Func<T> valueFactory,
LazyThreadSafetyMode
mode)
297
private Lazy(Func<T>? valueFactory,
LazyThreadSafetyMode
mode, bool useDefaultConstructor)
314
private void ViaFactory(
LazyThreadSafetyMode
mode)
345
ViaFactory(
LazyThreadSafetyMode
.ExecutionAndPublication);
405
ViaFactory(
LazyThreadSafetyMode
.None);
465
internal
LazyThreadSafetyMode
? Mode => LazyHelper.GetMode(_state);
496
/// The <see cref="Lazy{T}"/> was constructed with the <see cref="
LazyThreadSafetyMode
.ExecutionAndPublication"/> or
497
/// <see cref="
LazyThreadSafetyMode
.None"/> and the initialization function attempted to access <see cref="Value"/> on this instance.
501
/// Please <see cref="
LazyThreadSafetyMode
"/> for more information on how <see cref="Lazy{T}"/> will behave if an exception is thrown
529
public
LazyThreadSafetyMode
? Mode => _lazy.Mode;
src\libraries\System.Private.CoreLib\src\System\LazyOfTTMetadata.cs (2)
38
public Lazy(TMetadata metadata,
LazyThreadSafetyMode
mode) :
44
public Lazy(Func<T> valueFactory, TMetadata metadata,
LazyThreadSafetyMode
mode) :
System.Runtime (1)
artifacts\obj\System.Runtime\Debug\net11.0\System.Runtime.Forwards.cs (1)
821
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.
LazyThreadSafetyMode
))]
System.ServiceModel.Http (1)
System\ServiceModel\Channels\HttpChannelFactory.cs (1)
132
_webSocketSoapContentType = new Lazy<string>(() => MessageEncoderFactory.CreateSessionEncoder().ContentType,
LazyThreadSafetyMode
.ExecutionAndPublication);
Test.Utilities (1)
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (1)
41
LazyThreadSafetyMode
.ExecutionAndPublication);
Text.Analyzers (1)
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (1)
41
LazyThreadSafetyMode
.ExecutionAndPublication);