47 references to StrongBox
Microsoft.CodeAnalysis (6)
DiagnosticAnalyzer\AnalyzerExecutor.cs (1)
1215StrongBox<long> totalTicks = _analyzerExecutionTimeMap.GetOrAdd(analyzer, _ => new StrongBox<long>(0));
DiagnosticAnalyzer\DiagnosticStartAnalysisScope.cs (1)
642return InterlockedOperations.Initialize(ref _analyzerActions, static () => new StrongBox<AnalyzerActions>(AnalyzerActions.Empty));
DiagnosticAnalyzer\SuppressMessageAttributeState.cs (2)
233new StrongBox<ISymbol?>(_compilation.GetTypeByMetadataName("System.Diagnostics.CodeAnalysis.SuppressMessageAttribute")), 249new 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.CodeStyle (4)
src\Analyzers\Core\Analyzers\SimplifyTypeNames\SimplifyTypeNamesDiagnosticAnalyzerBase.cs (2)
229var (completed, intervalTree) = _codeBlockIntervals.GetOrAdd(context.CodeBlock.SyntaxTree, _ => (new StrongBox<bool>(false), new TextSpanMutableIntervalTree())); 273var (completed, intervalTree) = _codeBlockIntervals.GetOrAdd(context.SemanticModel.SyntaxTree, syntaxTree => (new StrongBox<bool>(true), null));
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 (6)
CodeGen\EmitStatement.cs (1)
427var destBox = new StrongBox<object?>(dest);
Symbols\Metadata\PE\PENamedTypeSymbol.cs (1)
400Interlocked.CompareExchange(ref uncommon.LazyExtensionParameter, new StrongBox<ParameterSymbol?>(extensionParameter), null);
Symbols\Retargeting\RetargetingNamedTypeSymbol.cs (1)
105Interlocked.CompareExchange(ref _lazyExtensionParameter, new StrongBox<ParameterSymbol>(extensionParameter), null);
Symbols\Source\SourcePropertySymbolBase.cs (2)
784Interlocked.CompareExchange(ref _lazyMergedBackingField, new StrongBox<SynthesizedBackingFieldSymbol?>(backingField), null); 805Interlocked.CompareExchange(ref _lazyMergedBackingField, new StrongBox<SynthesizedBackingFieldSymbol?>(backingField), null);
Symbols\SubstitutedNamedTypeSymbol.cs (1)
502Interlocked.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.EditorFeatures (1)
IntelliSense\AsyncCompletion\CompletionSource.cs (1)
552s_roslynItemToVsItemData.Add(roslynItem, new StrongBox<VSCompletionItemData>(itemData));
Microsoft.CodeAnalysis.Features (5)
AddImport\AbstractAddImportFeatureService.cs (1)
403static reference => new StrongBox<bool>(ComputeIsInPackagesDirectory(reference))).Value;
Common\AbstractProjectExtensionProvider.cs (1)
63=> s_referencesToExtensionsMap.GetValue(analyzerReferences, _ => new(ComputeExtensions(language, analyzerReferences))).Value;
Diagnostics\Service\EngineV2\DiagnosticIncrementalAnalyzer_IncrementalAnalyzer.cs (1)
47box = new(await ComputeForceAnalyzeProjectAsync().ConfigureAwait(false));
src\Analyzers\Core\Analyzers\SimplifyTypeNames\SimplifyTypeNamesDiagnosticAnalyzerBase.cs (2)
229var (completed, intervalTree) = _codeBlockIntervals.GetOrAdd(context.CodeBlock.SyntaxTree, _ => (new StrongBox<bool>(false), new TextSpanMutableIntervalTree())); 273var (completed, intervalTree) = _codeBlockIntervals.GetOrAdd(context.SemanticModel.SyntaxTree, syntaxTree => (new StrongBox<bool>(true), null));
Microsoft.CodeAnalysis.LanguageServer.Protocol (1)
Handler\RequestContext.cs (1)
187_lspSolution = new StrongBox<(Workspace Workspace, Solution Solution, TextDocument? Document)>((workspace, solution, document));
Microsoft.CodeAnalysis.Remote.ServiceHub (1)
Services\SourceGeneration\RemoteSourceGenerationService.cs (1)
84return new(generators.Any());
Microsoft.CodeAnalysis.VisualBasic (1)
Symbols\Metadata\PE\PEPropertySymbol.vb (1)
233Interlocked.CompareExchange(_lazyOverloadResolutionPriority, New StrongBox(Of Integer)(priority), Nothing)
Microsoft.CodeAnalysis.Workspaces (7)
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)));
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)
602=> 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)
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (2)
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)
263Volatile.Write(ref _isStdInRedirected, new StrongBox<bool>(ConsolePal.IsInputRedirectedCore())); 278Volatile.Write(ref _isStdOutRedirected, new StrongBox<bool>(ConsolePal.IsOutputRedirectedCore())); 293Volatile.Write(ref _isStdErrRedirected, new StrongBox<bool>(ConsolePal.IsErrorRedirectedCore()));
System.Linq.Expressions (4)
System\Linq\Expressions\Interpreter\LightCompiler.cs (1)
1679var 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\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs (1)
654props.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));