aboutsummaryrefslogtreecommitdiff
path: root/libjava/include/win32-threads.h
diff options
context:
space:
mode:
authorJerry Quinn <jlquinn@optonline.net>2003-10-21 04:46:19 +0000
committerJerry Quinn <jlquinn@gcc.gnu.org>2003-10-21 04:46:19 +0000
commit16a10fb6fc9e64b1eb38c85630ef7e20ca7ade64 (patch)
treeb5325b3608586fc1cc0a4882b22a1fee0f1262bb /libjava/include/win32-threads.h
parent036a75ac29ce155ea4c004d38ecce1e8c07f5272 (diff)
downloadgcc-16a10fb6fc9e64b1eb38c85630ef7e20ca7ade64.zip
gcc-16a10fb6fc9e64b1eb38c85630ef7e20ca7ade64.tar.gz
gcc-16a10fb6fc9e64b1eb38c85630ef7e20ca7ade64.tar.bz2
posix-threads.cc (_Jv_CondNotify,_Jv_CondNotifyAll): Rename _Jv_PthreadCheckMonitor to _Jv_MutexCheckMonitor.
2003-10-21 Jerry Quinn <jlquinn@optonline.net> * 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
Diffstat (limited to 'libjava/include/win32-threads.h')
-rw-r--r--libjava/include/win32-threads.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/libjava/include/win32-threads.h b/libjava/include/win32-threads.h
index ed5eb00..fdd21c5 100644
--- a/libjava/include/win32-threads.h
+++ b/libjava/include/win32-threads.h
@@ -86,6 +86,12 @@ int _Jv_CondNotifyAll (_Jv_ConditionVariable_t *cv, _Jv_Mutex_t *);
// We use CRITICAL_SECTIONs instead of CreateMutex() for better performance
//
+// Returns 0 if the mutex lock is held by the current thread, and 1 otherwise.
+inline int _Jv_MutexCheckMonitor (_Jv_Mutex_t *mu)
+{
+ return (mu->owner != GetCurrentThreadId ( ));
+}
+
inline void _Jv_MutexInit (_Jv_Mutex_t *mu)
{
mu->owner = 0UL;