From 16a10fb6fc9e64b1eb38c85630ef7e20ca7ade64 Mon Sep 17 00:00:00 2001 From: Jerry Quinn Date: Tue, 21 Oct 2003 04:46:19 +0000 Subject: posix-threads.cc (_Jv_CondNotify,_Jv_CondNotifyAll): Rename _Jv_PthreadCheckMonitor to _Jv_MutexCheckMonitor. 2003-10-21 Jerry Quinn * posix-threads.cc (_Jv_CondNotify,_Jv_CondNotifyAll): Rename _Jv_PthreadCheckMonitor to _Jv_MutexCheckMonitor. * include/no-threads.h (_Jv_MutexCheckMonitor): New. * include/posix-threads.h (_Jv_MutexCheckMonitor): Rename from _Jv_PthreadCheckMonitor. Simplify code. (_Jv_MutexUnlock): Use _Jv_MutexCheckMonitor. * include/win32-threads.h (_Jv_MutexCheckMonitor): New. * java/lang/Object.h (_Jv_ObjectCheckMonitor): Declare. * java/lang/Thread.java (holdsLock): New. * java/lang/natObject.cc (_Jv_ObjectCheckMonitor): New, with and without JV_HASH_SYNCHRONIZATION. * java/lang/natThread.cc (java::lang::Thread::holdsLock): New. From-SVN: r72741 --- libjava/java/lang/Thread.java | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'libjava/java/lang/Thread.java') diff --git a/libjava/java/lang/Thread.java b/libjava/java/lang/Thread.java index 64498b2..d537220 100644 --- a/libjava/java/lang/Thread.java +++ b/libjava/java/lang/Thread.java @@ -182,6 +182,15 @@ public class Thread implements Runnable } /** + * Return true if this Thread holds the object's lock, false otherwise. + * + * @param obj the object to test lock ownership on. + * @throws NullPointerException if obj is null. + * @since 1.4 + */ + public static native boolean holdsLock (Object obj); + + /** * Interrupt this Thread. First, there is a security check, * checkAccess. Then, depending on the current state of the * thread, various actions take place: -- cgit v1.1