326 references to Monitor
Microsoft.AspNetCore.DataProtection (2)
KeyManagement\KeyRingProvider.cs (2)
248Monitor.TryEnter(_cacheableKeyRingLockObj, (existingCacheableKeyRing != null) ? 0 : Timeout.Infinite, ref acquiredLock); 320Monitor.Exit(_cacheableKeyRingLockObj);
Microsoft.Build (25)
BackEnd\BuildManager\BuildManager.cs (20)
682Debug.Assert(Monitor.IsEntered(_syncLock)); 1368Debug.Assert(!Monitor.IsEntered(_syncLock)); 1382Debug.Assert(Monitor.IsEntered(_syncLock)); 1449Debug.Assert(Monitor.IsEntered(_syncLock)); 1640Debug.Assert(!Monitor.IsEntered(_syncLock)); 1661Debug.Assert(!Monitor.IsEntered(_syncLock)); 1717Debug.Assert(!Monitor.IsEntered(_syncLock)); 2224Debug.Assert(Monitor.IsEntered(_syncLock)); 2257Debug.Assert(Monitor.IsEntered(_syncLock)); 2265Debug.Assert(Monitor.IsEntered(_syncLock)); 2382Debug.Assert(Monitor.IsEntered(_syncLock)); 2408Debug.Assert(Monitor.IsEntered(_syncLock)); 2485Debug.Assert(Monitor.IsEntered(_syncLock)); 2580Debug.Assert(Monitor.IsEntered(_syncLock)); 2630Debug.Assert(Monitor.IsEntered(_syncLock)); 2795Debug.Assert(Monitor.IsEntered(_syncLock)); 2821Debug.Assert(Monitor.IsEntered(_syncLock)); 2964Debug.Assert(Monitor.IsEntered(_syncLock)); 3225Debug.Assert(Monitor.IsEntered(_syncLock)); 3306Debug.Assert(Monitor.IsEntered(_syncLock));
BackEnd\Components\RequestBuilder\RequestBuilder.cs (3)
492ErrorUtilities.VerifyThrow(Monitor.IsEntered(monitorLockObject), "Not running under the given lock"); 512Monitor.Exit(monitorLockObject); 520Monitor.Enter(monitorLockObject);
ErrorUtilities.cs (1)
133if (!Monitor.IsEntered(locker))
Evaluation\ProjectRootElementCache.cs (1)
258!System.Threading.Monitor.IsEntered(_locker),
Microsoft.Build.Engine.OM.UnitTests (1)
ErrorUtilities.cs (1)
133if (!Monitor.IsEntered(locker))
Microsoft.Build.Tasks.Core (1)
ErrorUtilities.cs (1)
133if (!Monitor.IsEntered(locker))
Microsoft.Build.Utilities.Core (1)
ErrorUtilities.cs (1)
133if (!Monitor.IsEntered(locker))
Microsoft.CSharp (1)
Microsoft\CSharp\RuntimeBinder\RuntimeBinder.cs (1)
129Debug.Assert(System.Threading.Monitor.IsEntered(s_bindLock));
Microsoft.Extensions.DependencyInjection (6)
ServiceLookup\CallSiteRuntimeResolver.cs (2)
123Monitor.Enter(sync, ref lockTaken); 148Monitor.Exit(sync);
ServiceLookup\ServiceLookupHelpers.cs (4)
32internal static readonly MethodInfo MonitorEnterMethodInfo = typeof(Monitor) 33.GetMethod(nameof(Monitor.Enter), BindingFlags.Public | BindingFlags.Static, null, new Type[] { typeof(object), typeof(bool).MakeByRefType() }, null)!; 34internal static readonly MethodInfo MonitorExitMethodInfo = typeof(Monitor) 35.GetMethod(nameof(Monitor.Exit), BindingFlags.Public | BindingFlags.Static, null, new Type[] { typeof(object) }, null)!;
Microsoft.Extensions.Http (2)
DefaultHttpClientFactory.cs (2)
255if (!Monitor.TryEnter(_cleanupActiveLock)) 306Monitor.Exit(_cleanupActiveLock);
Microsoft.Extensions.Logging.Console (7)
ConsoleLoggerProcessor.cs (7)
34Monitor.PulseAll(_messageQueue); 54Monitor.PulseAll(_messageQueue); 123Monitor.Wait(_messageQueue); 149Monitor.PulseAll(_messageQueue); 165Monitor.Wait(_messageQueue); 174Monitor.PulseAll(_messageQueue); 201Monitor.PulseAll(_messageQueue);
MSBuild (1)
ErrorUtilities.cs (1)
133if (!Monitor.IsEntered(locker))
MSBuildTaskHost (4)
Concurrent\ConcurrentDictionary.cs (4)
177lockTaken = Monitor.TryEnter(tables._locks[lockNo]); 247Monitor.Exit(tables._locks[lockNo]); 505lockTaken = Monitor.TryEnter(locks[i]); 526Monitor.Exit(_tables._locks[i]);
mscorlib (1)
src\libraries\shims\mscorlib\ref\mscorlib.cs (1)
1140[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.Monitor))]
netstandard (1)
netstandard.cs (1)
2090[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.Monitor))]
PresentationFramework (2)
MS\Internal\Utility\MonitorWrapper.cs (2)
26Monitor.Enter(_syncRoot); 35Monitor.Exit(_syncRoot);
System.Collections.Concurrent (21)
System\Collections\Concurrent\ConcurrentBag.cs (14)
149Debug.Assert(Monitor.IsEntered(GlobalQueuesLock)); 321Debug.Assert(Monitor.IsEntered(GlobalQueuesLock)); 617Debug.Assert(!Monitor.IsEntered(GlobalQueuesLock)); 618Monitor.Enter(GlobalQueuesLock, ref lockTaken); 624Monitor.Enter(queue, ref queue._frozen); 644Debug.Assert(Monitor.IsEntered(GlobalQueuesLock) == lockTaken); 653Monitor.Exit(queue); 658Monitor.Exit(GlobalQueuesLock); 782Monitor.Enter(this, ref lockTaken); 836Monitor.Exit(this); 899Monitor.Enter(this, ref lockTaken); 926Monitor.Exit(this); 1027Debug.Assert(Monitor.IsEntered(this)); 1060Debug.Assert(Monitor.IsEntered(this));
System\Collections\Concurrent\ConcurrentDictionary.cs (7)
920Monitor.Enter(locks[lockNo], ref lockTaken); 1013Monitor.Exit(locks[lockNo]); 2063Debug.Assert(!Monitor.IsEntered(locks[0])); 2065Monitor.Enter(locks[0]); 2079Debug.Assert(Monitor.IsEntered(locks[0])); 2084Monitor.Enter(locks[i]); 2100Monitor.Exit(locks[i]);
System.ComponentModel.Composition (2)
System\ComponentModel\Composition\Hosting\CompositionLock.cs (2)
67Monitor.Enter(_compositionLock); 76Monitor.Exit(_compositionLock);
System.Composition.Hosting (2)
System\Composition\Hosting\Core\CompositionOperation.cs (2)
91Monitor.Enter(sharingLock); 129Monitor.Exit(_sharingLock);
System.Configuration.ConfigurationManager (2)
System\Configuration\ClientConfigurationSystem.cs (2)
107Monitor.Wait(this); 189Monitor.PulseAll(this);
System.Console (1)
System\Console.cs (1)
198Debug.Assert(!Monitor.IsEntered(s_syncObject));
System.Data.Odbc (5)
Common\System\Data\ProviderBase\DbConnectionPool.cs (2)
1076Monitor.TryEnter(obj, ref locked); 1095Monitor.Exit(obj);
src\libraries\Common\src\System\Data\ProviderBase\DbConnectionFactory.cs (1)
134Debug.Assert(Monitor.IsEntered(s_pendingOpenNonPooled), $"Expected {nameof(s_pendingOpenNonPooled)} lock to be held.");
src\libraries\Common\src\System\Data\ProviderBase\DbReferenceCollection.cs (2)
272Monitor.TryEnter(_itemLock, LockPollTime, ref lockObtained); 280Monitor.Exit(_itemLock);
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.Linq.Parallel (7)
System\Linq\Parallel\Merging\OrderPreservingPipeliningMergeHelper.cs (4)
366Monitor.Pulse(locks[i]); 410Monitor.Wait(bufferLock); 428Monitor.Pulse(bufferLock); 490Monitor.Pulse(bufferLock);
System\Linq\Parallel\Scheduling\OrderPreservingPipeliningSpoolingTask.cs (3)
127Monitor.Pulse(_bufferLock); 137Monitor.Wait(_bufferLock); 204Monitor.Pulse(_bufferLock);
System.Net.Http (28)
System\Net\Http\Headers\HttpHeaders.cs (2)
751Debug.Assert(Monitor.IsEntered(info)); 1171Debug.Assert(Monitor.IsEntered(info));
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.cs (2)
308Debug.Assert(!Monitor.IsEntered(_http11Connections)); 313public 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)
259Debug.Assert(Monitor.IsEntered(SyncObject)); 367Debug.Assert(Monitor.IsEntered(SyncObject)); 740Debug.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)
64Debug.Assert(Monitor.IsEntered(SyncObj)); 119Debug.Assert(Monitor.IsEntered(SyncObj));
System.Net.NameResolution (1)
System\Net\Dns.cs (1)
670Debug.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 (4)
System\Net\Sockets\SocketAsyncContext.Unix.cs (4)
720Debug.Assert(!Monitor.IsEntered(_lockObject)); 723bool success = Monitor.TryEnter(_lockObject, 10000); 732Debug.Assert(Monitor.IsEntered(_lockObject)); 733Monitor.Exit(_lockObject);
System.Net.WebSockets (1)
System\Net\WebSockets\ManagedWebSocket.cs (1)
211Debug.Assert(Monitor.IsEntered(StateUpdateLock), $"Expected {nameof(StateUpdateLock)} to be held");
System.Private.CoreLib (60)
src\libraries\System.Private.CoreLib\src\System\Buffers\SharedArrayPool.cs (4)
396Monitor.Enter(this); 412Monitor.Exit(this); 420Monitor.Enter(this); 429Monitor.Exit(this);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\CounterGroup.cs (3)
113Debug.Assert(Monitor.IsEntered(s_counterGroupLock)); 154Debug.Assert(Monitor.IsEntered(s_counterGroupLock)); 189Debug.Assert(Monitor.IsEntered(s_counterGroupLock));
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\DiagnosticCounter.cs (1)
119Debug.Assert(Monitor.IsEntered(this));
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventCounter.cs (2)
82Debug.Assert(Monitor.IsEntered(this)); 176Debug.Assert(Monitor.IsEntered(this));
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventPipeEventDispatcher.cs (3)
68Debug.Assert(Monitor.IsEntered(m_dispatchControlLock)); 134Debug.Assert(Monitor.IsEntered(m_dispatchControlLock)); 144Debug.Assert(Monitor.IsEntered(m_dispatchControlLock));
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventProvider.cs (1)
170Debug.Assert(!Monitor.IsEntered(EventListener.EventListenersLock));
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventSource.cs (4)
1473Debug.Assert(!Monitor.IsEntered(EventListener.EventListenersLock)); 2799Debug.Assert(Monitor.IsEntered(EventListener.EventListenersLock)); 4238Debug.Assert(!Monitor.IsEntered(EventListenersLock)); 4285Debug.Assert(Monitor.IsEntered(EventListenersLock));
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\RuntimeEventSource.cs (1)
108_monitorContentionCounter ??= new IncrementingPollingCounter("monitor-lock-contention-count", this, () => Monitor.LockContentionCount) { DisplayName = "Monitor Lock Contention Count", DisplayRateTimeScale = new TimeSpan(0, 0, 1) };
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)
340Debug.Assert(Monitor.IsEntered(this)); // uses _store 541Debug.Assert(Monitor.IsEntered(this)); // uses _store 561Debug.Assert(Monitor.IsEntered(this)); // uses _store 623Debug.Assert(Monitor.IsEntered(this)); // uses _store 643Debug.Assert(Monitor.IsEntered(this)); // uses _store 781Debug.Assert(!Monitor.IsEntered(this)); // only called during init 804Debug.Assert(!Monitor.IsEntered(this)); // only called during init 993Debug.Assert(Monitor.IsEntered(this)); // uses _store 1033Debug.Assert(Monitor.IsEntered(this)); // uses _store 1117Debug.Assert(!Monitor.IsEntered(_reader));
src\libraries\System.Private.CoreLib\src\System\Resources\RuntimeResourceSet.cs (1)
288Debug.Assert(!Monitor.IsEntered(reader));
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\ConditionalWeakTable.cs (2)
295Debug.Assert(Monitor.IsEntered(table._lock), "Must hold the _lock lock to construct the enumerator"); 395Debug.Assert(Monitor.IsEntered(_lock));
src\libraries\System.Private.CoreLib\src\System\SR.cs (2)
52Monitor.Enter(_lock, ref lockTaken); 114Monitor.Exit(_lock);
src\libraries\System.Private.CoreLib\src\System\Threading\ManualResetEventSlim.cs (3)
283Monitor.PulseAll(m_lock); 578if (!Monitor.Wait(m_lock, realMillisecondsTimeout)) 655Monitor.PulseAll(mre.m_lock); // awaken all waiters
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 (8)
344Monitor.Enter(m_lockObjAndDisposed, ref lockTaken); 409Monitor.Exit(m_lockObjAndDisposed); 454bool waitSuccessful = Monitor.Wait(m_lockObjAndDisposed, remainingWaitMilliseconds); 644Debug.Assert(Monitor.IsEntered(m_lockObjAndDisposed), "Requires the lock be held"); 674Debug.Assert(Monitor.IsEntered(m_lockObjAndDisposed), "Requires the lock be held"); 701Debug.Assert(Monitor.IsEntered(m_lockObjAndDisposed), "Requires the lock be held"); 806Monitor.Pulse(m_lockObjAndDisposed); 896Monitor.PulseAll(semaphore.m_lockObjAndDisposed); // wake up all waiters.
src\libraries\System.Private.CoreLib\src\System\Threading\SpinLock.cs (1)
25/// cref="Monitor"/>, in size or due to garbage collection pressure, is overly
src\libraries\System.Private.CoreLib\src\System\Threading\SpinWait.cs (1)
54/// <see cref="Monitor"/>. For most purposes where spin waiting is required, however,
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\Threading\Tasks\Task.cs (2)
3484Monitor.Enter(list); 3485Monitor.Exit(list);
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)
281Debug.Assert(Monitor.IsEntered(cachedData)); 297Debug.Assert(Monitor.IsEntered(cachedData));
src\System\RuntimeType.CoreCLR.cs (4)
418Monitor.Enter(this, ref lockTaken); 482Monitor.Exit(this); 1693Monitor.Enter(s_methodInstantiationsLock, ref lockTaken); 1714Monitor.Exit(s_methodInstantiationsLock);
src\System\Threading\Monitor.CoreCLR.cs (1)
188/// Gets the number of times there was contention upon trying to take a <see cref="Monitor"/>'s lock so far.
System.Private.Uri (1)
System\Uri.cs (1)
3782Debug.Assert((_flags & Flags.Debug_LeftConstructor) == 0 || (!_syntax.IsSimple && Monitor.IsEntered(_info)));
System.Private.Xml (11)
System\Xml\Schema\Preprocessor.cs (3)
134Monitor.Enter(listSchema); 161Monitor.Exit(listSchema); 166Monitor.Exit(listSchema); //Release locks on all schema objects
System\Xml\Schema\XmlSchemaSet.cs (8)
312Monitor.TryEnter(InternalSyncObject, ref thisLockObtained); 315Monitor.TryEnter(schemas.InternalSyncObject, ref schemasLockObtained); 322Monitor.Exit(InternalSyncObject); //Give up this lock and try both again 368Monitor.Exit(InternalSyncObject); 372Monitor.Exit(schemas.InternalSyncObject); 516Monitor.Enter(currentSchema); 562Monitor.Exit(currentSchema); 567Monitor.Exit(currentSchema);
System.Reflection.MetadataLoadContext (2)
System\Reflection\TypeLoading\Modules\GetTypeCoreCache.cs (2)
31Monitor.Enter(_lock); 43Monitor.Exit(_lock);
System.Resources.Extensions (11)
src\libraries\System.Private.CoreLib\src\System\Resources\ResourceReader.cs (10)
340Debug.Assert(Monitor.IsEntered(this)); // uses _store 541Debug.Assert(Monitor.IsEntered(this)); // uses _store 561Debug.Assert(Monitor.IsEntered(this)); // uses _store 623Debug.Assert(Monitor.IsEntered(this)); // uses _store 643Debug.Assert(Monitor.IsEntered(this)); // uses _store 781Debug.Assert(!Monitor.IsEntered(this)); // only called during init 804Debug.Assert(!Monitor.IsEntered(this)); // only called during init 993Debug.Assert(Monitor.IsEntered(this)); // uses _store 1033Debug.Assert(Monitor.IsEntered(this)); // uses _store 1117Debug.Assert(!Monitor.IsEntered(_reader));
src\libraries\System.Private.CoreLib\src\System\Resources\RuntimeResourceSet.cs (1)
288Debug.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.Text.Json (1)
System\Text\Json\Serialization\Metadata\JsonTypeInfo.cs (1)
733Debug.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)
113Debug.Assert(Monitor.IsEntered(this)); 127Debug.Assert(Monitor.IsEntered(this)); 151Debug.Assert(Monitor.IsEntered(this)); 205Debug.Assert(Monitor.IsEntered(this));
System.Threading (1)
artifacts\obj\System.Threading\Debug\net9.0\System.Threading.Forwards.cs (1)
18[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.Monitor))]
System.Threading.Channels (12)
System\Threading\Channels\BoundedChannel.cs (10)
246Debug.Assert(Monitor.IsEntered(parent.SyncObj)); 364Monitor.Enter(parent.SyncObj, ref releaseLock); 425Monitor.Exit(parent.SyncObj); 440Monitor.Exit(parent.SyncObj); 451Monitor.Exit(parent.SyncObj); 539Monitor.Enter(parent.SyncObj, ref releaseLock); 616Monitor.Exit(parent.SyncObj); 631Monitor.Exit(parent.SyncObj); 642Monitor.Exit(parent.SyncObj); 679Debug.Assert(Monitor.IsEntered(SyncObj), "Invariants can only be validated while holding the lock.");
System\Threading\Channels\UnboundedChannel.cs (2)
169Debug.Assert(parent._items.IsThreadSafe || Monitor.IsEntered(parent.SyncObj)); 368Debug.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))
System.Transactions.Local (69)
System\Transactions\CommittableTransaction.cs (2)
109} while (Monitor.Wait(_internalTransaction)); 178} while (Monitor.Wait(_internalTransaction));
System\Transactions\DurableEnlistmentState.cs (4)
93Monitor.Exit(enlistment.Transaction); 114Monitor.Enter(enlistment.Transaction); 144Monitor.Exit(enlistment.Transaction); 170Monitor.Enter(enlistment.Transaction);
System\Transactions\EnlistmentState.cs (14)
115Monitor.Exit(enlistment.SyncRoot); 123Monitor.Enter(enlistment.SyncRoot); 129Monitor.Exit(enlistment.SyncRoot); 137Monitor.Enter(enlistment.SyncRoot); 143Monitor.Exit(enlistment.SyncRoot); 151Monitor.Enter(enlistment.SyncRoot); 157Monitor.Exit(enlistment.SyncRoot); 165Monitor.Enter(enlistment.SyncRoot); 171Monitor.Exit(enlistment.SyncRoot); 179Monitor.Enter(enlistment.SyncRoot); 185Monitor.Exit(enlistment.SyncRoot); 193Monitor.Enter(enlistment.SyncRoot); 199Monitor.Exit(enlistment.SyncRoot); 207Monitor.Enter(enlistment.SyncRoot);
System\Transactions\InternalTransaction.cs (2)
352Monitor.Exit(this); // Don't hold a lock calling user code. 360Monitor.Enter(this);
System\Transactions\TransactionState.cs (27)
1348Monitor.Pulse(tx); 1672Monitor.Exit(tx); 1685Monitor.Enter(tx); 1701Monitor.Exit(tx); 1714Monitor.Enter(tx); 1732Monitor.Exit(tx); 1755Monitor.Enter(tx); 1773Monitor.Exit(tx); 1796Monitor.Enter(tx); 1809Monitor.Exit(tx); 1816Monitor.Enter(tx); 1899Monitor.Exit(tx); 1913Monitor.Enter(tx); 1942Monitor.Exit(tx); 1956Monitor.Enter(tx); 2538Monitor.Exit(tx); 2547Monitor.Enter(tx); 2646Monitor.Exit(tx); 2655Monitor.Enter(tx); 2763Monitor.Exit(tx); 2772Monitor.Enter(tx); 2805Monitor.Exit(tx); 2814Monitor.Enter(tx); 4614Monitor.Exit(tx); 4629Monitor.Enter(tx); 4649Monitor.Exit(tx); 4664Monitor.Enter(tx);
System\Transactions\TransactionTable.cs (2)
79Monitor.Enter(SyncRoot); 115Monitor.Exit(SyncRoot);
System\Transactions\VolatileEnlistmentMultiplexing.cs (8)
88Monitor.TryEnter(demux._transaction, 250, ref tookLock); 109Monitor.Exit(demux._transaction); 127Monitor.TryEnter(demux._transaction, 250, ref tookLock); 148Monitor.Exit(demux._transaction); 166Monitor.TryEnter(demux._transaction, 250, ref tookLock); 187Monitor.Exit(demux._transaction); 205Monitor.TryEnter(demux._transaction, 250, ref tookLock); 226Monitor.Exit(demux._transaction);
System\Transactions\VolatileEnlistmentState.cs (10)
138Monitor.Exit(enlistment.Transaction); 152Monitor.Enter(enlistment.Transaction); 219Monitor.Exit(enlistment.Transaction); 234Monitor.Enter(enlistment.Transaction); 363Monitor.Exit(enlistment.Transaction); 377Monitor.Enter(enlistment.Transaction); 406Monitor.Exit(enlistment.Transaction); 421Monitor.Enter(enlistment.Transaction); 440Monitor.Exit(enlistment.Transaction); 455Monitor.Enter(enlistment.Transaction);