IsHeldByCurrentThread Property
Collapse the table of content
Expand the table of content

SpinLock.IsHeldByCurrentThread Property

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Gets whether the lock is held by the current thread.

Namespace:  System.Threading
Assembly:  mscorlib (in mscorlib.dll)

'Declaration
Public ReadOnly Property IsHeldByCurrentThread As Boolean

Property Value

Type: System.Boolean
true if the lock is held by the current thread; otherwise false.

ExceptionCondition
InvalidOperationException

Thread ownership tracking is disabled.

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.

Windows Phone OS

Supported in: 8.1, 8.0

Show:
© 2017 Microsoft