Lock.IsHeldByCurrentThread 属性

定义

获取一个值,该值指示当前线程是否持有锁。

public:
 property bool IsHeldByCurrentThread { bool get(); };
public bool IsHeldByCurrentThread { get; }
member this.IsHeldByCurrentThread : bool
Public ReadOnly Property IsHeldByCurrentThread As Boolean

属性值

true 如果当前线程持有锁,则为 ;否则为 false

适用于