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