132 references to CurrentManagedThreadId
Client.TypedClient.IntegrationTests (3)
TypedProxyTests.4.0.0.cs (3)
192int startThread = Environment.CurrentManagedThreadId; 195Assert.True(startThread == Environment.CurrentManagedThreadId, String.Format("Expected continuation to happen on thread {0} but actually continued on thread {1}", 196startThread, Environment.CurrentManagedThreadId));
csc (3)
src\Compilers\Core\CommandLine\CompilerServerLogger.cs (1)
152var threadId = Environment.CurrentManagedThreadId;
src\Compilers\Shared\BuildServerConnection.cs (2)
207var originalThreadId = Environment.CurrentManagedThreadId; 268var releaseThreadId = Environment.CurrentManagedThreadId;
dotnet-svcutil-lib (2)
FrameworkFork\System.ServiceModel\Internals\System\Runtime\SynchronizedPool.cs (2)
211int thisThreadID = Environment.CurrentManagedThreadId; 264int thisThreadID = Environment.CurrentManagedThreadId;
Microsoft.AspNetCore.Components.WebAssembly (1)
Rendering\WebAssemblyDispatcher.cs (1)
16public override bool CheckAccess() => _mainManagedThreadId == Environment.CurrentManagedThreadId;
Microsoft.AspNetCore.InternalTesting (2)
CultureReplacer.cs (2)
34_threadId = Environment.CurrentManagedThreadId; 73Assert.True(Environment.CurrentManagedThreadId == _threadId,
Microsoft.Build.Tasks.CodeAnalysis (3)
src\Compilers\Core\CommandLine\CompilerServerLogger.cs (1)
152var threadId = Environment.CurrentManagedThreadId;
src\Compilers\Shared\BuildServerConnection.cs (2)
207var originalThreadId = Environment.CurrentManagedThreadId; 268var releaseThreadId = Environment.CurrentManagedThreadId;
Microsoft.CodeAnalysis.CodeStyle (3)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\NonReentrantLock.cs (3)
46/// The <see cref="Environment.CurrentManagedThreadId" /> of the thread that holds the lock. Zero if no thread is holding 192return _owningThreadId == Environment.CurrentManagedThreadId; 203_owningThreadId = Environment.CurrentManagedThreadId;
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (1)
Threading\StaTaskScheduler.cs (1)
25public bool IsRunningInScheduler => StaThread.ManagedThreadId == Environment.CurrentManagedThreadId;
Microsoft.CodeAnalysis.InteractiveHost (3)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\NonReentrantLock.cs (3)
46/// The <see cref="Environment.CurrentManagedThreadId" /> of the thread that holds the lock. Zero if no thread is holding 192return _owningThreadId == Environment.CurrentManagedThreadId; 203_owningThreadId = Environment.CurrentManagedThreadId;
Microsoft.CodeAnalysis.Test.Utilities (6)
FX\EnsureEnglishUICulture.cs (3)
35_threadId = Environment.CurrentManagedThreadId; 49Debug.Assert(_threadId == Environment.CurrentManagedThreadId); 51if (_needToRestore && _threadId == Environment.CurrentManagedThreadId)
FX\EnsureInvariantCulture.cs (3)
20_threadId = Environment.CurrentManagedThreadId; 28Debug.Assert(_threadId == Environment.CurrentManagedThreadId); 30if (_threadId == Environment.CurrentManagedThreadId)
Microsoft.CodeAnalysis.Workspaces (6)
Log\TraceLogger.cs (3)
22=> Trace.WriteLine(string.Format("[{0}] {1} - {2}", Environment.CurrentManagedThreadId, functionId.ToString(), logMessage.GetMessage())); 25=> Trace.WriteLine(string.Format("[{0}] Start({1}) : {2} - {3}", Environment.CurrentManagedThreadId, uniquePairId, functionId.ToString(), logMessage.GetMessage())); 30Trace.WriteLine(string.Format("[{0}] End({1}) : [{2}ms] {3}", Environment.CurrentManagedThreadId, uniquePairId, delta, functionString));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\NonReentrantLock.cs (3)
46/// The <see cref="Environment.CurrentManagedThreadId" /> of the thread that holds the lock. Zero if no thread is holding 192return _owningThreadId == Environment.CurrentManagedThreadId; 203_owningThreadId = Environment.CurrentManagedThreadId;
Microsoft.Extensions.Telemetry (1)
Enrichment\ProcessLogEnricher.cs (1)
32_threadId ??= Environment.CurrentManagedThreadId.ToInvariantString();
PresentationCore (39)
MS\Internal\AppModel\SiteOfOriginContainer.cs (2)
48Environment.CurrentManagedThreadId + 195Environment.CurrentManagedThreadId +
MS\Internal\AppModel\SiteOfOriginPart.cs (9)
52Environment.CurrentManagedThreadId + 64Environment.CurrentManagedThreadId + 92Environment.CurrentManagedThreadId + 108Environment.CurrentManagedThreadId + 122Environment.CurrentManagedThreadId + 135Environment.CurrentManagedThreadId + 161Environment.CurrentManagedThreadId + 185Environment.CurrentManagedThreadId + 195Environment.CurrentManagedThreadId +
System\IO\Packaging\PackWebRequest.cs (3)
83Environment.CurrentManagedThreadId + ": " + 155Environment.CurrentManagedThreadId + ": " + 171Environment.CurrentManagedThreadId + ": " +
System\IO\Packaging\PackWebRequestFactory.cs (3)
67Environment.CurrentManagedThreadId + ": " + 106Environment.CurrentManagedThreadId + ": " + 119Environment.CurrentManagedThreadId + ": " +
System\IO\Packaging\PackWebResponse.cs (22)
71Environment.CurrentManagedThreadId + ": " + 94Environment.CurrentManagedThreadId + ": " + 104Environment.CurrentManagedThreadId + ": " + 138Environment.CurrentManagedThreadId + ": " + 177Environment.CurrentManagedThreadId + ": " + 199Environment.CurrentManagedThreadId + ": " + 491Environment.CurrentManagedThreadId + ": " + 511Environment.CurrentManagedThreadId + ": " + 524Environment.CurrentManagedThreadId + ": " + 550Environment.CurrentManagedThreadId + ": " + 609Environment.CurrentManagedThreadId + ": " + 626Environment.CurrentManagedThreadId + ": " + 635Environment.CurrentManagedThreadId + ": " + 653Environment.CurrentManagedThreadId + ": " + 666Environment.CurrentManagedThreadId + ": " + 677Environment.CurrentManagedThreadId + ": " + 779Environment.CurrentManagedThreadId + ": " + 801Environment.CurrentManagedThreadId + ": " + 816Environment.CurrentManagedThreadId + ": " + 845Environment.CurrentManagedThreadId + ": " + 887Environment.CurrentManagedThreadId + ": " + 902Environment.CurrentManagedThreadId + ": " +
Replay (3)
src\Compilers\Core\CommandLine\CompilerServerLogger.cs (1)
152var threadId = Environment.CurrentManagedThreadId;
src\Compilers\Shared\BuildServerConnection.cs (2)
207var originalThreadId = Environment.CurrentManagedThreadId; 268var releaseThreadId = Environment.CurrentManagedThreadId;
Roslyn.VisualStudio.DiagnosticsWindow (3)
Loggers\OutputWindowLogger.cs (3)
35OutputPane.WriteLine(string.Format("[{0}] {1} - {2}", Environment.CurrentManagedThreadId, functionId.ToString(), logMessage.GetMessage())); 40OutputPane.WriteLine(string.Format("[{0}] Start({1}) : {2} - {3}", Environment.CurrentManagedThreadId, uniquePairId, functionId.ToString(), logMessage.GetMessage())); 46OutputPane.WriteLine(string.Format("[{0}] End({1}) : [{2}ms] {3}", Environment.CurrentManagedThreadId, uniquePairId, delta, functionString));
Stress.ApiService (1)
Program.cs (1)
127new KeyValuePair<string, object?>("Tid", Environment.CurrentManagedThreadId),
System.Collections.Concurrent (6)
System\Collections\Concurrent\ConcurrentBag.cs (6)
154int currentThreadId = Environment.CurrentManagedThreadId; 699_ownerThreadId = Environment.CurrentManagedThreadId; 724Debug.Assert(Environment.CurrentManagedThreadId == _ownerThreadId); 844Debug.Assert(Environment.CurrentManagedThreadId == _ownerThreadId); 861Debug.Assert(Environment.CurrentManagedThreadId == _ownerThreadId); 936Debug.Assert(Environment.CurrentManagedThreadId == _ownerThreadId);
System.Diagnostics.TextWriterTraceListener (1)
System\Diagnostics\XmlWriterTraceListener.cs (1)
273InternalWrite((uint)Environment.CurrentManagedThreadId);
System.Diagnostics.TraceSource (1)
System\Diagnostics\TraceEventCache.cs (1)
40return Environment.CurrentManagedThreadId.ToString(CultureInfo.InvariantCulture);
System.Linq (2)
System\Linq\Iterator.cs (2)
33private readonly int _threadId = Environment.CurrentManagedThreadId; 74Iterator<TSource> enumerator = _state == 0 && _threadId == Environment.CurrentManagedThreadId ? this : Clone();
System.Linq.Parallel (2)
System\Linq\Parallel\Channels\AsynchronousChannel.cs (2)
207Environment.CurrentManagedThreadId); 221Environment.CurrentManagedThreadId);
System.Net.Sockets (1)
System\Net\Sockets\SafeSocketHandle.cs (1)
164_closeSocketThread = Environment.CurrentManagedThreadId;
System.Private.CoreLib (20)
src\libraries\System.Private.CoreLib\src\System\AppDomain.cs (1)
221public static int GetCurrentThreadId() => Environment.CurrentManagedThreadId;
src\libraries\System.Private.CoreLib\src\System\IO\Iterator.cs (2)
21_threadId = Environment.CurrentManagedThreadId; 42if (state == 0 && _threadId == Environment.CurrentManagedThreadId)
src\libraries\System.Private.CoreLib\src\System\Threading\CancellationTokenRegistration.cs (2)
52node.Registrations.ThreadIDExecutingCallbacks != Environment.CurrentManagedThreadId) // The executing thread ID is not this thread's ID. 82node.Registrations.ThreadIDExecutingCallbacks != Environment.CurrentManagedThreadId) // The executing thread ID is not this thread's ID.
src\libraries\System.Private.CoreLib\src\System\Threading\CancellationTokenSource.cs (3)
749registrations.ThreadIDExecutingCallbacks = Environment.CurrentManagedThreadId; 807n.Registrations.ThreadIDExecutingCallbacks = Environment.CurrentManagedThreadId; 810registrations.ThreadIDExecutingCallbacks = Environment.CurrentManagedThreadId; // above may have altered ThreadIDExecutingCallbacks, so reset it
src\libraries\System.Private.CoreLib\src\System\Threading\Lock.NonNativeAot.cs (1)
64id = (uint)Environment.CurrentManagedThreadId;
src\libraries\System.Private.CoreLib\src\System\Threading\ProcessorIdCache.cs (1)
34currentProcessorId = Environment.CurrentManagedThreadId;
src\libraries\System.Private.CoreLib\src\System\Threading\ReaderWriterLockSlim.cs (8)
300int id = Environment.CurrentManagedThreadId; 445int id = Environment.CurrentManagedThreadId; 652int id = Environment.CurrentManagedThreadId; 789if (Environment.CurrentManagedThreadId == _upgradeLockOwnerId) 810if (Environment.CurrentManagedThreadId != _writeLockOwnerId) 857if (Environment.CurrentManagedThreadId != _upgradeLockOwnerId) 1379if (Environment.CurrentManagedThreadId == _upgradeLockOwnerId) 1403if (Environment.CurrentManagedThreadId == _writeLockOwnerId)
src\libraries\System.Private.CoreLib\src\System\Threading\SpinLock.cs (2)
414int newOwner = Environment.CurrentManagedThreadId; 576return (_owner & (~LOCK_ID_DISABLE_MASK)) == Environment.CurrentManagedThreadId;
System.Private.Windows.Core.TestUtilities (6)
NoAssertContext.cs (6)
34s_suppressedThreads.AddOrUpdate(Environment.CurrentManagedThreadId, 1, (key, oldValue) => oldValue + 1); 65int currentThread = Environment.CurrentManagedThreadId; 129if (!s_suppressedThreads.TryGetValue(Environment.CurrentManagedThreadId, out _)) 137if (!s_suppressedThreads.TryGetValue(Environment.CurrentManagedThreadId, out _)) 147if (!s_suppressedThreads.TryGetValue(Environment.CurrentManagedThreadId, out _)) 155if (!s_suppressedThreads.TryGetValue(Environment.CurrentManagedThreadId, out _))
System.Runtime.Caching (1)
System\Runtime\Caching\Dbg.cs (1)
39Environment.CurrentManagedThreadId,
System.Threading (6)
System\Threading\Barrier.cs (5)
329if (_actionCallerID != 0 && Environment.CurrentManagedThreadId == _actionCallerID) 424if (_actionCallerID != 0 && Environment.CurrentManagedThreadId == _actionCallerID) 637if (_actionCallerID != 0 && Environment.CurrentManagedThreadId == _actionCallerID) 773_actionCallerID = Environment.CurrentManagedThreadId; 911if (_actionCallerID != 0 && Environment.CurrentManagedThreadId == _actionCallerID)
System\Threading\ReaderWriterLock.cs (1)
1002int threadID = Environment.CurrentManagedThreadId;
vbc (3)
src\Compilers\Core\CommandLine\CompilerServerLogger.cs (1)
152var threadId = Environment.CurrentManagedThreadId;
src\Compilers\Shared\BuildServerConnection.cs (2)
207var originalThreadId = Environment.CurrentManagedThreadId; 268var releaseThreadId = Environment.CurrentManagedThreadId;
VBCSCompiler (3)
src\Compilers\Core\CommandLine\CompilerServerLogger.cs (1)
152var threadId = Environment.CurrentManagedThreadId;
src\Compilers\Shared\BuildServerConnection.cs (2)
207var originalThreadId = Environment.CurrentManagedThreadId; 268var releaseThreadId = Environment.CurrentManagedThreadId;