ReaderWriterLockSlim.IsUpgradeableReadLockHeld Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets a value that indicates whether the current thread has entered the lock in upgradeable mode.
public:
property bool IsUpgradeableReadLockHeld { bool get(); };
public bool IsUpgradeableReadLockHeld { get; }
member this.IsUpgradeableReadLockHeld : bool
Public ReadOnly Property IsUpgradeableReadLockHeld As Boolean
Property Value
true
if the current thread has entered upgradeable mode; otherwise, false
.
Examples
The following example shows how to use the IsUpgradeableReadLockHeld property to generate an assert if the current thread has entered upgradeable mode unexpectedly.
using (ReaderWriterLockSlim rwLock = new ReaderWriterLockSlim()) {
Using rwLock As New ReaderWriterLockSlim()
Debug.Assert(!rwLock.IsUpgradeableReadLockHeld,
String.Format("Thread {0} has entered the upgradeable read lock while MyFunction is still executing.",
Thread.CurrentThread.ManagedThreadId));
Debug.Assert(Not rwLock.IsUpgradeableReadLockHeld, _
String.Format("Thread {0} has entered the upgradeable read lock while MyFunction is still executing.", _
Thread.CurrentThread.ManagedThreadId))
Remarks
This property is intended for use in asserts or for other debugging purposes. Do not use it to control the flow of program execution.
Applies to
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기