61 references to StrongBox
Aspire.Hosting.Integration.Analyzers (1)
AspireExportAnalyzer.cs (1)
159var assemblyHasAspireExport = new StrongBox<bool>(
GenerateDocumentationAndConfigFiles (2)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\InterlockedOperations.cs (2)
87var box = Volatile.Read(ref target!) ?? GetOrStore(ref target, new StrongBox<T?>(valueFactory())); 105var box = Volatile.Read(ref target!) ?? GetOrStore(ref target, new StrongBox<T?>(valueFactory(arg)));
Microsoft.Build (1)
Logging\BinaryLogger\BuildEventArgsWriter.cs (1)
1233metadataRecordIds.Add(backingMetadata, new StrongBox<int>(metadataRecordId));
Microsoft.CodeAnalysis (6)
DiagnosticAnalyzer\AnalyzerExecutor.cs (1)
1361StrongBox<long> totalTicks = _analyzerExecutionTimeMap.GetOrAdd(analyzer, _ => new StrongBox<long>(0));
DiagnosticAnalyzer\DiagnosticStartAnalysisScope.cs (1)
659return InterlockedOperations.Initialize(ref _analyzerActions, static () => new StrongBox<AnalyzerActions>(AnalyzerActions.Empty));
DiagnosticAnalyzer\SuppressMessageAttributeState.cs (2)
262new StrongBox<ISymbol?>(_compilation.GetTypeByMetadataName("System.Diagnostics.CodeAnalysis.SuppressMessageAttribute")), 278new StrongBox<ISymbol?>(_compilation.GetTypeByMetadataName("System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute")),
InternalUtilities\InterlockedOperations.cs (2)
87var box = Volatile.Read(ref target!) ?? GetOrStore(ref target, new StrongBox<T?>(valueFactory())); 105var box = Volatile.Read(ref target!) ?? GetOrStore(ref target, new StrongBox<T?>(valueFactory(arg)));
Microsoft.CodeAnalysis.Analyzers (2)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\InterlockedOperations.cs (2)
87var box = Volatile.Read(ref target!) ?? GetOrStore(ref target, new StrongBox<T?>(valueFactory())); 105var box = Volatile.Read(ref target!) ?? GetOrStore(ref target, new StrongBox<T?>(valueFactory(arg)));
Microsoft.CodeAnalysis.AnalyzerUtilities (2)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\InterlockedOperations.cs (2)
87var box = Volatile.Read(ref target!) ?? GetOrStore(ref target, new StrongBox<T?>(valueFactory())); 105var box = Volatile.Read(ref target!) ?? GetOrStore(ref target, new StrongBox<T?>(valueFactory(arg)));
Microsoft.CodeAnalysis.CodeStyle (4)
src\roslyn\src\Analyzers\Core\Analyzers\SimplifyTypeNames\SimplifyTypeNamesDiagnosticAnalyzerBase.cs (2)
215var (completed, intervalTree) = _codeBlockIntervals.GetOrAdd(context.CodeBlock.SyntaxTree, _ => (new StrongBox<bool>(false), new TextSpanMutableIntervalTree())); 259var (completed, intervalTree) = _codeBlockIntervals.GetOrAdd(context.SemanticModel.SyntaxTree, syntaxTree => (new StrongBox<bool>(true), null));
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\InterlockedOperations.cs (2)
87var box = Volatile.Read(ref target!) ?? GetOrStore(ref target, new StrongBox<T?>(valueFactory())); 105var box = Volatile.Read(ref target!) ?? GetOrStore(ref target, new StrongBox<T?>(valueFactory(arg)));
Microsoft.CodeAnalysis.CSharp (11)
CodeGen\EmitStatement.cs (1)
427var destBox = new StrongBox<object?>(dest);
Declarations\DeclarationTreeBuilder.cs (2)
39private static readonly BoxedMemberNames s_emptyMemberNames = new BoxedMemberNames(ImmutableSegmentedHashSet<string>.Empty); 1085: new BoxedMemberNames(ImmutableSegmentedHashSet.CreateRange(memberNamesBuilder));
Symbols\AliasSymbol.cs (1)
329bool won = Interlocked.Exchange(ref _aliasTargetDiagnostics, new StrongBox<ReadOnlyBindingDiagnostic<AssemblySymbol>>(newDiagnostics.ToReadOnlyAndFree(forceDiagnosticResolution: false))) == null;
Symbols\Extensions\SourceExtensionImplementationMethodSymbol.cs (1)
100Interlocked.CompareExchange(ref lazyNullableContext, new StrongBox<byte?>(nullableContext), comparand: null);
Symbols\Metadata\PE\PENamedTypeSymbol.cs (1)
430Interlocked.CompareExchange(ref uncommon.LazyExtensionParameter, new StrongBox<ParameterSymbol?>(extensionParameter), null);
Symbols\NamedTypeSymbol.cs (1)
2696lazyUnionData._lazyValueDeclaredNullableFlowState = new StrongBox<NullableFlowState>(result);
Symbols\Retargeting\RetargetingNamedTypeSymbol.cs (1)
109Interlocked.CompareExchange(ref _lazyExtensionParameter, new StrongBox<ParameterSymbol>(extensionParameter), null);
Symbols\Source\SourcePropertySymbolBase.cs (2)
788Interlocked.CompareExchange(ref _lazyMergedBackingField, new StrongBox<SynthesizedBackingFieldSymbol?>(backingField), null); 809Interlocked.CompareExchange(ref _lazyMergedBackingField, new StrongBox<SynthesizedBackingFieldSymbol?>(backingField), null);
Symbols\SubstitutedNamedTypeSymbol.cs (1)
508Interlocked.CompareExchange(ref _lazyExtensionParameter, new StrongBox<ParameterSymbol?>(substituteParameter()), null);
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
Simplification\Simplifiers\AbstractCSharpSimplifier.cs (1)
200hasAliases = new StrongBox<bool>(ComputeHasUsingAliases(semanticModel, cancellationToken));
Microsoft.CodeAnalysis.Features (5)
AddImport\AbstractAddImportFeatureService.cs (1)
405static reference => new StrongBox<bool>(ComputeIsInPackagesDirectory(reference))).Value;
Common\AbstractProjectExtensionProvider.cs (1)
63=> s_referencesToExtensionsMap.GetValue(analyzerReferences, _ => new(ComputeExtensions(language, analyzerReferences))).Value;
Diagnostics\Service\DiagnosticAnalyzerService.HostAnalyzerInfo.cs (1)
81lazyAnalyzers = new(ComputeProjectAnalyzers());
src\roslyn\src\Analyzers\Core\Analyzers\SimplifyTypeNames\SimplifyTypeNamesDiagnosticAnalyzerBase.cs (2)
215var (completed, intervalTree) = _codeBlockIntervals.GetOrAdd(context.CodeBlock.SyntaxTree, _ => (new StrongBox<bool>(false), new TextSpanMutableIntervalTree())); 259var (completed, intervalTree) = _codeBlockIntervals.GetOrAdd(context.SemanticModel.SyntaxTree, syntaxTree => (new StrongBox<bool>(true), null));
Microsoft.CodeAnalysis.NetAnalyzers (1)
Microsoft.NetCore.Analyzers\Resources\MarkAssembliesWithNeutralResourcesLanguage.cs (1)
72var alreadyReportedDiagnostic = new StrongBox<bool>(false);
Microsoft.CodeAnalysis.ResxSourceGenerator (2)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\InterlockedOperations.cs (2)
87var box = Volatile.Read(ref target!) ?? GetOrStore(ref target, new StrongBox<T?>(valueFactory())); 105var box = Volatile.Read(ref target!) ?? GetOrStore(ref target, new StrongBox<T?>(valueFactory(arg)));
Microsoft.CodeAnalysis.VisualBasic (1)
Symbols\Metadata\PE\PEPropertySymbol.vb (1)
233Interlocked.CompareExchange(_lazyOverloadResolutionPriority, New StrongBox(Of Integer)(priority), Nothing)
Microsoft.CodeAnalysis.Workspaces (8)
FindSymbols\FindReferences\DependentTypeFinder_ProjectIndex.cs (1)
51tuple = new((checksum, AsyncLazy.Create(CreateIndexAsync, project)));
FindSymbols\Shared\AbstractSyntaxIndex_Persistence.cs (1)
125new StrongBox<Checksum>(CodeAnalysis.Checksum.Create(parseOptions.PreprocessorSymbolNames)));
Log\WorkspaceStructureLogger.cs (1)
271compilation, _ => new StrongBox<int>(Interlocked.Increment(ref _nextCompilationId)));
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\InterlockedOperations.cs (2)
87var box = Volatile.Read(ref target!) ?? GetOrStore(ref target, new StrongBox<T?>(valueFactory())); 105var box = Volatile.Read(ref target!) ?? GetOrStore(ref target, new StrongBox<T?>(valueFactory(arg)));
Workspace\Solution\FileTextLoader.cs (1)
68GetType(), _ => new StrongBox<bool>(new Func<Stream, Workspace, SourceText>(CreateText).Method.DeclaringType != typeof(FileTextLoader))).Value;
Workspace\Solution\StateChecksums.cs (1)
600=> s_objectToChecksumCollectionCache.GetValue(value, _ => new StrongBox<TResult>(checksumCreator(value, arg))).Value;
Workspace\Solution\TextLoader.cs (1)
65_ => new StrongBox<bool>(new Func<Workspace, DocumentId, CancellationToken, Task<TextAndVersion>>(LoadTextAndVersionAsync).Method.DeclaringType != typeof(TextLoader))).Value)
Roslyn.Diagnostics.Analyzers (2)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\InterlockedOperations.cs (2)
87var box = Volatile.Read(ref target!) ?? GetOrStore(ref target, new StrongBox<T?>(valueFactory())); 105var box = Volatile.Read(ref target!) ?? GetOrStore(ref target, new StrongBox<T?>(valueFactory(arg)));
System.Collections.Concurrent (2)
System\Collections\Concurrent\PartitionerStatic.cs (2)
419_localOffset = new StrongBox<int>(-1); 420_currentChunkSize = new StrongBox<int>(0);
System.Console (3)
System\Console.cs (3)
264Volatile.Write(ref _isStdInRedirected, new StrongBox<bool>(ConsolePal.IsInputRedirectedCore())); 279Volatile.Write(ref _isStdOutRedirected, new StrongBox<bool>(ConsolePal.IsOutputRedirectedCore())); 294Volatile.Write(ref _isStdErrRedirected, new StrongBox<bool>(ConsolePal.IsErrorRedirectedCore()));
System.Linq.Expressions (4)
System\Linq\Expressions\Interpreter\LightCompiler.cs (1)
1698var nullCase = new StrongBox<int>(1);
System\Linq\Expressions\Interpreter\LocalAccess.cs (3)
305frame.Data[_index] = new StrongBox<object>(_defaultValue); 338frame.Data[_index] = new StrongBox<object?>(frame.Data[_index]); 439frame.Data[_index] = new StrongBox<object?>(value);
System.Private.CoreLib (1)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs (1)
802props.m_cancellationRegistration = new StrongBox<CancellationTokenRegistration>(ctr);
System.Threading.Tasks.Parallel (1)
System\Threading\Tasks\ParallelRangeManager.cs (1)
109Interlocked.CompareExchange(ref _indexRanges[_nCurrentIndexRange]._nSharedCurrentIndexOffset, new StrongBox<long>(0), null);
System.Windows.Forms (1)
System\Windows\Forms\PropertyStore.cs (1)
229_values[key] = Value.Create(new StrongBox<T>(value));