Lock.IsHeldByCurrentThread 属性

定义

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

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

属性值

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

适用于