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
This commit is contained in:
Jerry Quinn 2003-10-21 04:46:19 +00:00 committed by Jerry Quinn
parent 036a75ac29
commit 16a10fb6fc
9 changed files with 96 additions and 8 deletions

View file

@ -77,12 +77,9 @@ typedef struct
// this out. Returns 0 if the lock is held by the current thread, and
// 1 otherwise.
inline int
_Jv_PthreadCheckMonitor (_Jv_Mutex_t *mu)
_Jv_MutexCheckMonitor (_Jv_Mutex_t *mu)
{
pthread_t self = pthread_self();
if (mu->owner == self)
return 0;
else return 1;
return (mu->owner != pthread_self());
}
//
@ -155,7 +152,7 @@ _Jv_MutexLock (_Jv_Mutex_t *mu)
inline int
_Jv_MutexUnlock (_Jv_Mutex_t *mu)
{
if (_Jv_PthreadCheckMonitor (mu))
if (_Jv_MutexCheckMonitor (mu))
{
# ifdef LOCK_DEBUG
fprintf(stderr, "_Jv_MutexUnlock: Not owner\n");