ReaderWriterLockSlim.RecursiveUpgradeCount 属性

定义

获取当前线程进入可升级模式锁定状态的次数,用于指示递归。Gets the number of times the current thread has entered the lock in upgradeable mode, as an indication of recursion.

public:
 property int RecursiveUpgradeCount { int get(); };
public int RecursiveUpgradeCount { get; }
member this.RecursiveUpgradeCount : int
Public ReadOnly Property RecursiveUpgradeCount As Integer

属性值

Int32

如果当前线程未进入可升级模式,则为 0; 如果线程已进入可升级模式但尚未以递归方式进入,则为 1; 如果线程已进入可升级模式,则为 n -1 次。0 if the current thread has not entered upgradeable mode, 1 if the thread has entered upgradeable mode but has not entered it recursively, or n if the thread has entered upgradeable mode recursively n - 1 times.

注解

此属性仅用于调试、分析和日志记录目的,而不用于控制算法的行为。Use this property only for debugging, profiling, and logging purposes, and not to control the behavior of an algorithm. 计算结果后,结果就会更改。The results can change as soon as they have been calculated. 因此,根据此属性做出决策并不安全。Therefore, it is not safe to make decisions based on this property.

适用于