117 references to IsEntered
Aspire.Hosting (3)
ApplicationModel\ResourceLoggerService.cs (3)
471Debug.Assert(Monitor.IsEntered(_lock)); 482Debug.Assert(Monitor.IsEntered(_lock)); 497Debug.Assert(Monitor.IsEntered(_lock));
GenerateDocumentationAndConfigFiles (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (2)
140Contract.ThrowIfTrue(Monitor.IsEntered(SyncObject), "Attempt to take the lock while already holding it!"); 153Contract.ThrowIfFalse(Monitor.IsEntered(asyncLazy.SyncObject));
Metrics (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (2)
140Contract.ThrowIfTrue(Monitor.IsEntered(SyncObject), "Attempt to take the lock while already holding it!"); 153Contract.ThrowIfFalse(Monitor.IsEntered(asyncLazy.SyncObject));
Metrics.Legacy (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (2)
140Contract.ThrowIfTrue(Monitor.IsEntered(SyncObject), "Attempt to take the lock while already holding it!"); 153Contract.ThrowIfFalse(Monitor.IsEntered(asyncLazy.SyncObject));
Microsoft.CodeAnalysis.Analyzers (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (2)
140Contract.ThrowIfTrue(Monitor.IsEntered(SyncObject), "Attempt to take the lock while already holding it!"); 153Contract.ThrowIfFalse(Monitor.IsEntered(asyncLazy.SyncObject));
Microsoft.CodeAnalysis.AnalyzerUtilities (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (2)
140Contract.ThrowIfTrue(Monitor.IsEntered(SyncObject), "Attempt to take the lock while already holding it!"); 153Contract.ThrowIfFalse(Monitor.IsEntered(asyncLazy.SyncObject));
Microsoft.CodeAnalysis.BannedApiAnalyzers (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (2)
140Contract.ThrowIfTrue(Monitor.IsEntered(SyncObject), "Attempt to take the lock while already holding it!"); 153Contract.ThrowIfFalse(Monitor.IsEntered(asyncLazy.SyncObject));
Microsoft.CodeAnalysis.CodeStyle (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (2)
140Contract.ThrowIfTrue(Monitor.IsEntered(SyncObject), "Attempt to take the lock while already holding it!"); 153Contract.ThrowIfFalse(Monitor.IsEntered(asyncLazy.SyncObject));
Microsoft.CodeAnalysis.Features (3)
Extensions\ExtensionFolder.cs (2)
117Contract.ThrowIfTrue(!Monitor.IsEntered(_extensionMessageHandlerService._gate)); 140Contract.ThrowIfTrue(!Monitor.IsEntered(_extensionMessageHandlerService._gate));
Extensions\ExtensionMessageHandlerService.cs (1)
68Contract.ThrowIfTrue(!Monitor.IsEntered(_gate));
Microsoft.CodeAnalysis.InteractiveHost (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (2)
140Contract.ThrowIfTrue(Monitor.IsEntered(SyncObject), "Attempt to take the lock while already holding it!"); 153Contract.ThrowIfFalse(Monitor.IsEntered(asyncLazy.SyncObject));
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (2)
140Contract.ThrowIfTrue(Monitor.IsEntered(SyncObject), "Attempt to take the lock while already holding it!"); 153Contract.ThrowIfFalse(Monitor.IsEntered(asyncLazy.SyncObject));
Microsoft.CodeAnalysis.PublicApiAnalyzers (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (2)
140Contract.ThrowIfTrue(Monitor.IsEntered(SyncObject), "Attempt to take the lock while already holding it!"); 153Contract.ThrowIfFalse(Monitor.IsEntered(asyncLazy.SyncObject));
Microsoft.CodeAnalysis.ResxSourceGenerator (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (2)
140Contract.ThrowIfTrue(Monitor.IsEntered(SyncObject), "Attempt to take the lock while already holding it!"); 153Contract.ThrowIfFalse(Monitor.IsEntered(asyncLazy.SyncObject));
Microsoft.CodeAnalysis.Workspaces (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (2)
140Contract.ThrowIfTrue(Monitor.IsEntered(SyncObject), "Attempt to take the lock while already holding it!"); 153Contract.ThrowIfFalse(Monitor.IsEntered(asyncLazy.SyncObject));
Microsoft.CSharp (1)
Microsoft\CSharp\RuntimeBinder\RuntimeBinder.cs (1)
132Debug.Assert(System.Threading.Monitor.IsEntered(s_bindLock));
Roslyn.Diagnostics.Analyzers (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (2)
140Contract.ThrowIfTrue(Monitor.IsEntered(SyncObject), "Attempt to take the lock while already holding it!"); 153Contract.ThrowIfFalse(Monitor.IsEntered(asyncLazy.SyncObject));
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)
2085Debug.Assert(!Monitor.IsEntered(locks[0])); 2101Debug.Assert(Monitor.IsEntered(locks[0]));
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.Linq.Expressions (1)
System\Dynamic\Utils\ContractUtils.cs (1)
125Debug.Assert(Monitor.IsEntered(lockObject), "Expected lock is not held.");
System.Private.CoreLib (38)
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 (2)
68Debug.Assert(Monitor.IsEntered(m_dispatchControlLock)); 134Debug.Assert(Monitor.IsEntered(m_dispatchControlLock));
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventPipeEventDispatcher.Threads.cs (1)
13Debug.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)
1541Debug.Assert(!Monitor.IsEntered(EventListener.EventListenersLock)); 2663Debug.Assert(Monitor.IsEntered(EventListener.EventListenersLock)); 2879Debug.Assert(Monitor.IsEntered(EventListener.EventListenersLock)); 4399Debug.Assert(!Monitor.IsEntered(EventListenersLock)); 4446Debug.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)
338Debug.Assert(Monitor.IsEntered(this)); // uses _store 539Debug.Assert(Monitor.IsEntered(this)); // uses _store 559Debug.Assert(Monitor.IsEntered(this)); // uses _store 621Debug.Assert(Monitor.IsEntered(this)); // uses _store 641Debug.Assert(Monitor.IsEntered(this)); // uses _store 779Debug.Assert(!Monitor.IsEntered(this)); // only called during init 802Debug.Assert(!Monitor.IsEntered(this)); // only called during init 991Debug.Assert(Monitor.IsEntered(this)); // uses _store 1031Debug.Assert(Monitor.IsEntered(this)); // uses _store 1115Debug.Assert(!Monitor.IsEntered(_reader));
src\libraries\System.Private.CoreLib\src\System\Resources\RuntimeResourceSet.cs (1)
281Debug.Assert(!Monitor.IsEntered(reader));
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\ConditionalWeakTable.cs (2)
400Debug.Assert(Monitor.IsEntered(table._lock), "Must hold the _lock lock to construct the enumerator"); 500Debug.Assert(Monitor.IsEntered(_lock));
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)
3821Debug.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)
338Debug.Assert(Monitor.IsEntered(this)); // uses _store 539Debug.Assert(Monitor.IsEntered(this)); // uses _store 559Debug.Assert(Monitor.IsEntered(this)); // uses _store 621Debug.Assert(Monitor.IsEntered(this)); // uses _store 641Debug.Assert(Monitor.IsEntered(this)); // uses _store 779Debug.Assert(!Monitor.IsEntered(this)); // only called during init 802Debug.Assert(!Monitor.IsEntered(this)); // only called during init 991Debug.Assert(Monitor.IsEntered(this)); // uses _store 1031Debug.Assert(Monitor.IsEntered(this)); // uses _store 1115Debug.Assert(!Monitor.IsEntered(_reader));
src\libraries\System.Private.CoreLib\src\System\Resources\RuntimeResourceSet.cs (1)
281Debug.Assert(!Monitor.IsEntered(reader));
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)
743Debug.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 (6)
System\Threading\Channels\BoundedChannel.cs (2)
242Debug.Assert(Monitor.IsEntered(parent.SyncObj)); 696Debug.Assert(Monitor.IsEntered(SyncObj), "Invariants can only be validated while holding the lock.");
System\Threading\Channels\RendezvousChannel.cs (1)
493Debug.Assert(Monitor.IsEntered(SyncObj), "Invariants can only be validated while holding the lock.");
System\Threading\Channels\UnboundedChannel.cs (1)
335Debug.Assert(Monitor.IsEntered(SyncObj), "Invariants can only be validated while holding the lock.");
System\Threading\Channels\UnboundedPriorityChannel.cs (2)
138Debug.Assert(Monitor.IsEntered(parent.SyncObj)); 341Debug.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)
742if (outgoingLockKnownAcquired || Monitor.IsEntered(OutgoingLock))
Test.Utilities (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (2)
140Contract.ThrowIfTrue(Monitor.IsEntered(SyncObject), "Attempt to take the lock while already holding it!"); 153Contract.ThrowIfFalse(Monitor.IsEntered(asyncLazy.SyncObject));
Text.Analyzers (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (2)
140Contract.ThrowIfTrue(Monitor.IsEntered(SyncObject), "Attempt to take the lock while already holding it!"); 153Contract.ThrowIfFalse(Monitor.IsEntered(asyncLazy.SyncObject));