169 references to IsEntered
Aspire.Hosting (3)
ApplicationModel\ResourceLoggerService.cs (3)
436Debug.Assert(Monitor.IsEntered(_lock)); 447Debug.Assert(Monitor.IsEntered(_lock)); 462Debug.Assert(Monitor.IsEntered(_lock));
Microsoft.Build (23)
BackEnd\BuildManager\BuildManager.cs (20)
677Debug.Assert(Monitor.IsEntered(_syncLock)); 1354Debug.Assert(!Monitor.IsEntered(_syncLock)); 1368Debug.Assert(Monitor.IsEntered(_syncLock)); 1470Debug.Assert(Monitor.IsEntered(_syncLock)); 1661Debug.Assert(!Monitor.IsEntered(_syncLock)); 1682Debug.Assert(!Monitor.IsEntered(_syncLock)); 1763Debug.Assert(!Monitor.IsEntered(_syncLock)); 2217Debug.Assert(Monitor.IsEntered(_syncLock)); 2250Debug.Assert(Monitor.IsEntered(_syncLock)); 2258Debug.Assert(Monitor.IsEntered(_syncLock)); 2375Debug.Assert(Monitor.IsEntered(_syncLock)); 2401Debug.Assert(Monitor.IsEntered(_syncLock)); 2478Debug.Assert(Monitor.IsEntered(_syncLock)); 2570Debug.Assert(Monitor.IsEntered(_syncLock)); 2619Debug.Assert(Monitor.IsEntered(_syncLock)); 2745Debug.Assert(Monitor.IsEntered(_syncLock)); 2771Debug.Assert(Monitor.IsEntered(_syncLock)); 2915Debug.Assert(Monitor.IsEntered(_syncLock)); 3179Debug.Assert(Monitor.IsEntered(_syncLock)); 3260Debug.Assert(Monitor.IsEntered(_syncLock));
BackEnd\Components\RequestBuilder\RequestBuilder.cs (1)
493ErrorUtilities.VerifyThrow(Monitor.IsEntered(monitorLockObject), "Not running under the given lock");
ErrorUtilities.cs (1)
136if (!Monitor.IsEntered(locker))
Evaluation\ProjectRootElementCache.cs (1)
258!System.Threading.Monitor.IsEntered(_locker),
Microsoft.Build.Engine.OM.UnitTests (1)
ErrorUtilities.cs (1)
136if (!Monitor.IsEntered(locker))
Microsoft.Build.Tasks.Core (1)
ErrorUtilities.cs (1)
136if (!Monitor.IsEntered(locker))
Microsoft.Build.Utilities.Core (1)
ErrorUtilities.cs (1)
136if (!Monitor.IsEntered(locker))
Microsoft.CodeAnalysis.CodeStyle (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (1)
139Contract.ThrowIfTrue(Monitor.IsEntered(SyncObject), "Attempt to take the lock while already holding it!");
Microsoft.CodeAnalysis.EditorFeatures.Wpf (1)
BackgroundWorkIndicator\BackgroundWorkIndicatorScope.cs (1)
44Contract.ThrowIfFalse(Monitor.IsEntered(_context.Gate));
Microsoft.CodeAnalysis.InteractiveHost (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (1)
139Contract.ThrowIfTrue(Monitor.IsEntered(SyncObject), "Attempt to take the lock while already holding it!");
Microsoft.CodeAnalysis.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (1)
139Contract.ThrowIfTrue(Monitor.IsEntered(SyncObject), "Attempt to take the lock while already holding it!");
Microsoft.CSharp (1)
Microsoft\CSharp\RuntimeBinder\RuntimeBinder.cs (1)
129Debug.Assert(System.Threading.Monitor.IsEntered(s_bindLock));
MSBuild (1)
ErrorUtilities.cs (1)
136if (!Monitor.IsEntered(locker))
System.Collections.Concurrent (8)
System\Collections\Concurrent\ConcurrentBag.cs (6)
149Debug.Assert(Monitor.IsEntered(GlobalQueuesLock)); 321Debug.Assert(Monitor.IsEntered(GlobalQueuesLock)); 617Debug.Assert(!Monitor.IsEntered(GlobalQueuesLock)); 644Debug.Assert(Monitor.IsEntered(GlobalQueuesLock) == lockTaken); 1027Debug.Assert(Monitor.IsEntered(this)); 1060Debug.Assert(Monitor.IsEntered(this));
System\Collections\Concurrent\ConcurrentDictionary.cs (2)
2110Debug.Assert(!Monitor.IsEntered(locks[0])); 2126Debug.Assert(Monitor.IsEntered(locks[0]));
System.Console (1)
System\Console.cs (1)
198Debug.Assert(!Monitor.IsEntered(s_syncObject));
System.Data.Odbc (1)
src\libraries\Common\src\System\Data\ProviderBase\DbConnectionFactory.cs (1)
134Debug.Assert(Monitor.IsEntered(s_pendingOpenNonPooled), $"Expected {nameof(s_pendingOpenNonPooled)} lock to be held.");
System.Diagnostics.DiagnosticSource (1)
System\Diagnostics\DiagnosticListener.cs (1)
360Debug.Assert(Monitor.IsEntered(s_allListenersLock)); // We should only be called when we hold this lock
System.Diagnostics.Process (6)
System\Diagnostics\ProcessWaitState.Unix.cs (6)
238Debug.Assert(!Monitor.IsEntered(_gate)); 253Debug.Assert(Monitor.IsEntered(_gate)); 266Debug.Assert(!Monitor.IsEntered(_gate)); 348Debug.Assert(Monitor.IsEntered(_gate)); 397Debug.Assert(!Monitor.IsEntered(_gate)); 506Debug.Assert(Monitor.IsEntered(_gate));
System.Linq.Expressions (1)
System\Dynamic\Utils\ContractUtils.cs (1)
125Debug.Assert(Monitor.IsEntered(lockObject), "Expected lock is not held.");
System.Net.Http (28)
System\Net\Http\Headers\HttpHeaders.cs (2)
798Debug.Assert(Monitor.IsEntered(info)); 1218Debug.Assert(Monitor.IsEntered(info));
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.cs (2)
312Debug.Assert(!Monitor.IsEntered(_http11Connections)); 317public bool HasSyncObjLock => Monitor.IsEntered(_http11Connections);
System\Net\Http\SocketsHttpHandler\CreditManager.cs (1)
161Debug.Assert(Monitor.IsEntered(SyncObject), "Shouldn't be called outside lock.");
System\Net\Http\SocketsHttpHandler\Http2Connection.cs (3)
268Debug.Assert(Monitor.IsEntered(SyncObject)); 369Debug.Assert(Monitor.IsEntered(SyncObject)); 748Debug.Assert(!Monitor.IsEntered(SyncObject));
System\Net\Http\SocketsHttpHandler\Http2Stream.cs (18)
245Debug.Assert(!Monitor.IsEntered(SyncObject)); 287Debug.Assert(!Monitor.IsEntered(SyncObject)); 364Debug.Assert(Monitor.IsEntered(SyncObject)); 383Debug.Assert(Monitor.IsEntered(SyncObject)); 410Debug.Assert(!Monitor.IsEntered(SyncObject)); 453Debug.Assert(Monitor.IsEntered(SyncObject)); 619Debug.Assert(!Monitor.IsEntered(SyncObject)); 683Debug.Assert(!Monitor.IsEntered(SyncObject)); 763Debug.Assert(!Monitor.IsEntered(SyncObject)); 786Debug.Assert(!Monitor.IsEntered(SyncObject)); 869Debug.Assert(!Monitor.IsEntered(SyncObject)); 949Debug.Assert(!Monitor.IsEntered(SyncObject)); 1013Debug.Assert(Monitor.IsEntered(SyncObject)); 1034Debug.Assert(!Monitor.IsEntered(SyncObject)); 1108Debug.Assert(!Monitor.IsEntered(SyncObject)); 1376Debug.Assert(!Monitor.IsEntered(SyncObject)); 1421Debug.Assert(!Monitor.IsEntered(SyncObject)); 1459Debug.Assert(!Monitor.IsEntered(thisRef.SyncObject));
System\Net\Http\SocketsHttpHandler\Http3Connection.cs (2)
66Debug.Assert(Monitor.IsEntered(SyncObj)); 130Debug.Assert(Monitor.IsEntered(SyncObj));
System.Net.NameResolution (1)
System\Net\Dns.cs (1)
700Debug.Assert(!Monitor.IsEntered(s_tasks));
System.Net.NetworkInformation (4)
System\Net\NetworkInformation\NetworkAddressChange.Unix.cs (4)
24Debug.Assert(Monitor.IsEntered(s_gate)); 29Debug.Assert(Monitor.IsEntered(s_gate)); 152Debug.Assert(Monitor.IsEntered(s_gate)); 177Debug.Assert(Monitor.IsEntered(s_gate));
System.Net.Quic (8)
src\libraries\Common\src\System\Net\StreamBuffer.cs (8)
39Debug.Assert(!Monitor.IsEntered(SyncObject)); 51Debug.Assert(!Monitor.IsEntered(SyncObject)); 63Debug.Assert(!Monitor.IsEntered(SyncObject)); 80Debug.Assert(!Monitor.IsEntered(SyncObject)); 97Debug.Assert(!Monitor.IsEntered(SyncObject)); 179Debug.Assert(!Monitor.IsEntered(SyncObject)); 195Debug.Assert(!Monitor.IsEntered(SyncObject)); 258Debug.Assert(!Monitor.IsEntered(SyncObject));
System.Net.Sockets (2)
System\Net\Sockets\SocketAsyncContext.Unix.cs (2)
720Debug.Assert(!Monitor.IsEntered(_lockObject)); 732Debug.Assert(Monitor.IsEntered(_lockObject));
System.Net.WebSockets (4)
System\Net\WebSockets\ManagedWebSocket.cs (2)
236Debug.Assert(Monitor.IsEntered(StateUpdateLock), $"Expected {nameof(StateUpdateLock)} to be held"); 465Debug.Assert(Monitor.IsEntered(StateUpdateLock), $"Expected {nameof(StateUpdateLock)} to be held");
System\Net\WebSockets\ManagedWebSocket.KeepAlive.cs (2)
236Debug.Assert(Monitor.IsEntered(StateUpdateLock)); 253Debug.Assert(Monitor.IsEntered(StateUpdateLock));
System.Private.CoreLib (36)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\CounterGroup.cs (4)
111Debug.Assert(Monitor.IsEntered(s_counterGroupLock)); 152Debug.Assert(Monitor.IsEntered(s_counterGroupLock)); 188Debug.Assert(Monitor.IsEntered(s_counterGroupLock)); 204Debug.Assert(Monitor.IsEntered(s_counterGroupLock));
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\DiagnosticCounter.cs (1)
117Debug.Assert(Monitor.IsEntered(this));
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventCounter.cs (2)
80Debug.Assert(Monitor.IsEntered(this)); 174Debug.Assert(Monitor.IsEntered(this));
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventPipeEventDispatcher.cs (3)
68Debug.Assert(Monitor.IsEntered(m_dispatchControlLock)); 139Debug.Assert(Monitor.IsEntered(m_dispatchControlLock)); 149Debug.Assert(Monitor.IsEntered(m_dispatchControlLock));
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventProvider.cs (1)
165Debug.Assert(!Monitor.IsEntered(EventListener.EventListenersLock));
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventSource.cs (5)
1539Debug.Assert(!Monitor.IsEntered(EventListener.EventListenersLock)); 2653Debug.Assert(Monitor.IsEntered(EventListener.EventListenersLock)); 2868Debug.Assert(Monitor.IsEntered(EventListener.EventListenersLock)); 4408Debug.Assert(!Monitor.IsEntered(EventListenersLock)); 4455Debug.Assert(Monitor.IsEntered(EventListenersLock));
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\TraceLoggingEventHandleTable.cs (1)
41Debug.Assert(Monitor.IsEntered(this));
src\libraries\System.Private.CoreLib\src\System\Resources\ResourceReader.cs (10)
341Debug.Assert(Monitor.IsEntered(this)); // uses _store 542Debug.Assert(Monitor.IsEntered(this)); // uses _store 562Debug.Assert(Monitor.IsEntered(this)); // uses _store 624Debug.Assert(Monitor.IsEntered(this)); // uses _store 644Debug.Assert(Monitor.IsEntered(this)); // uses _store 782Debug.Assert(!Monitor.IsEntered(this)); // only called during init 805Debug.Assert(!Monitor.IsEntered(this)); // only called during init 994Debug.Assert(Monitor.IsEntered(this)); // uses _store 1034Debug.Assert(Monitor.IsEntered(this)); // uses _store 1118Debug.Assert(!Monitor.IsEntered(_reader));
src\libraries\System.Private.CoreLib\src\System\Resources\RuntimeResourceSet.cs (1)
287Debug.Assert(!Monitor.IsEntered(reader));
src\libraries\System.Private.CoreLib\src\System\Threading\PeriodicTimer.cs (1)
258Debug.Assert(!Monitor.IsEntered(this));
src\libraries\System.Private.CoreLib\src\System\Threading\SemaphoreSlim.cs (3)
665Debug.Assert(Monitor.IsEntered(m_lockObjAndDisposed), "Requires the lock be held"); 695Debug.Assert(Monitor.IsEntered(m_lockObjAndDisposed), "Requires the lock be held"); 722Debug.Assert(Monitor.IsEntered(m_lockObjAndDisposed), "Requires the lock be held");
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\ConcurrentExclusiveSchedulerPair.cs (1)
735Debug.Assert(Monitor.IsEntered(syncObj) == held, "The locking scheme was not correctly followed.");
src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.cs (1)
2055Debug.Assert(Monitor.IsEntered(cachedData));
src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.Unix.cs (2)
289Debug.Assert(Monitor.IsEntered(cachedData)); 315Debug.Assert(Monitor.IsEntered(cachedData));
System.Private.Uri (1)
System\Uri.cs (1)
3787Debug.Assert((_flags & Flags.Debug_LeftConstructor) == 0 || (!_syntax.IsSimple && Monitor.IsEntered(_info)));
System.Resources.Extensions (11)
src\libraries\System.Private.CoreLib\src\System\Resources\ResourceReader.cs (10)
341Debug.Assert(Monitor.IsEntered(this)); // uses _store 542Debug.Assert(Monitor.IsEntered(this)); // uses _store 562Debug.Assert(Monitor.IsEntered(this)); // uses _store 624Debug.Assert(Monitor.IsEntered(this)); // uses _store 644Debug.Assert(Monitor.IsEntered(this)); // uses _store 782Debug.Assert(!Monitor.IsEntered(this)); // only called during init 805Debug.Assert(!Monitor.IsEntered(this)); // only called during init 994Debug.Assert(Monitor.IsEntered(this)); // uses _store 1034Debug.Assert(Monitor.IsEntered(this)); // uses _store 1118Debug.Assert(!Monitor.IsEntered(_reader));
src\libraries\System.Private.CoreLib\src\System\Resources\RuntimeResourceSet.cs (1)
287Debug.Assert(!Monitor.IsEntered(reader));
System.Security.Cryptography (3)
System\Security\Cryptography\X509Certificates\OpenSslCachedSystemStoreProvider.cs (3)
115Monitor.IsEntered(s_recheckStopwatch), 145Monitor.IsEntered(s_recheckStopwatch), 310Monitor.IsEntered(s_recheckStopwatch),
System.ServiceModel.NetNamedPipe (6)
System\ServiceModel\Channels\PipeConnection.cs (6)
387Fx.Assert(Monitor.IsEntered(_readLock), "_readLock must be entered"); 393Fx.Assert(Monitor.IsEntered(_writeLock), "_writeLock must be entered"); 399Fx.Assert(Monitor.IsEntered(_readLock), "_readLock must be entered"); 405Fx.Assert(Monitor.IsEntered(_writeLock), "_writeLock must be entered"); 508Fx.Assert(Monitor.IsEntered(_readLock), "_readLock must be entered"); 530Fx.Assert(Monitor.IsEntered(_writeLock), "_writeLock must be entered");
System.Text.Json (1)
System\Text\Json\Serialization\Metadata\JsonTypeInfo.cs (1)
741Debug.Assert(Monitor.IsEntered(Options.CacheContext), "Configure called directly, use EnsureConfigured which synchronizes access to this method");
System.Text.RegularExpressions (4)
System\Text\RegularExpressions\Symbolic\SymbolicRegexMatcher.Automata.cs (4)
129Debug.Assert(Monitor.IsEntered(this)); 143Debug.Assert(Monitor.IsEntered(this)); 167Debug.Assert(Monitor.IsEntered(this)); 295Debug.Assert(Monitor.IsEntered(this));
System.Threading.Channels (5)
System\Threading\Channels\BoundedChannel.cs (2)
246Debug.Assert(Monitor.IsEntered(parent.SyncObj)); 679Debug.Assert(Monitor.IsEntered(SyncObj), "Invariants can only be validated while holding the lock.");
System\Threading\Channels\UnboundedChannel.cs (1)
330Debug.Assert(Monitor.IsEntered(SyncObj), "Invariants can only be validated while holding the lock.");
System\Threading\Channels\UnboundedPriorityChannel.cs (2)
141Debug.Assert(Monitor.IsEntered(parent.SyncObj)); 335Debug.Assert(Monitor.IsEntered(SyncObj), "Invariants can only be validated while holding the lock.");
System.Threading.Tasks.Dataflow (2)
Internal\Common.cs (1)
49Debug.Assert(Monitor.IsEntered(syncObj) == held, "The locking scheme was not correctly followed.");
Internal\SourceCore.cs (1)
748if (outgoingLockKnownAcquired || Monitor.IsEntered(OutgoingLock))