SpinLock.IsHeldByCurrentThread Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets whether the lock is held by the current thread.
public:
property bool IsHeldByCurrentThread { bool get(); };
public bool IsHeldByCurrentThread { get; }
member this.IsHeldByCurrentThread : bool
Public ReadOnly Property IsHeldByCurrentThread As Boolean
Property Value
true if the lock is held by the current thread; otherwise false.
Exceptions
Thread ownership tracking is disabled.
Remarks
If the lock was initialized to track owner threads, this will return whether the lock is acquired by the current thread. It is invalid to use this property when the lock was initialized to not track thread ownership.
Applies to
See also
Spolupracujte s námi na GitHubu
Zdroj tohoto obsahu najdete na GitHubu, kde můžete také vytvářet a kontrolovat problémy a žádosti o přijetí změn. Další informace najdete v našem průvodci pro přispěvatele.