ReaderWriterLockSlim.RecursiveWriteCount 属性

定义

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

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

属性值

Int32

如果当前线程未进入写入模式,则为 0; 如果线程已进入写入模式但尚未以递归方式进入写入模式,则为 1; 如果线程 已进入写入 模式,则为 n0 if the current thread has not entered write mode, 1 if the thread has entered write mode but has not entered it recursively, or n if the thread has entered write 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.

适用于