ReaderWriterLockSlim.RecursiveReadCount 屬性

定義

取得目前執行緒已進入讀取模式鎖定的次數,做為遞迴的表示。Gets the number of times the current thread has entered the lock in read mode, as an indication of recursion.

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

屬性值

如果目前線程尚未進入讀取模式, 則為 0 (零); 如果執行緒已進入讀取模式, 但是尚未以遞迴方式進入, 則為 1; 如果執行緒已遞迴進入鎖定n -1 次, 則為n0 (zero) if the current thread has not entered read mode, 1 if the thread has entered read mode but has not entered it recursively, or n if the thread has entered the lock 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.

適用於