Thread.HoldsLock(Object) Method
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.
Returns true
if and only if the current thread holds the
monitor lock on the specified object.
[Android.Runtime.Register("holdsLock", "(Ljava/lang/Object;)Z", "")]
public static bool HoldsLock(Java.Lang.Object obj);
[<Android.Runtime.Register("holdsLock", "(Ljava/lang/Object;)Z", "")>]
static member HoldsLock : Java.Lang.Object -> bool
- obj
- Object
the object on which to test lock ownership
true
if the current thread holds the monitor lock on
the specified object.
- Attributes
Returns true
if and only if the current thread holds the monitor lock on the specified object.
This method is designed to allow a program to assert that the current thread already holds a specified lock:
assert Thread.holdsLock(obj);
Added in 1.4.
Java documentation for java.lang.Thread.holdsLock(java.lang.Object)
.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Продукт | Версии |
---|---|
.NET for Android | .NET for Android API 34, .NET for Android API 35 |