Commit c45a8466 by Tom Tromey Committed by Tom Tromey

posix-threads.h (_Jv_PthreadCheckMonitor): Reverted previous change and…

posix-threads.h (_Jv_PthreadCheckMonitor): Reverted previous change and implemented a correct test in the __m_count case.

	* include/posix-threads.h (_Jv_PthreadCheckMonitor): Reverted
	previous change and implemented a correct test in the __m_count
	case.

From-SVN: r29209
parent e1b6684c
1999-09-08 Tom Tromey <tromey@cygnus.com> 1999-09-08 Tom Tromey <tromey@cygnus.com>
* include/posix-threads.h (_Jv_PthreadCheckMonitor): Reverted
previous change and implemented a correct test in the __m_count
case.
* include/posix-threads.h (_Jv_PthreadCheckMonitor): Changed test * include/posix-threads.h (_Jv_PthreadCheckMonitor): Changed test
in __m_count case. in __m_count case.
......
...@@ -114,7 +114,9 @@ _Jv_PthreadCheckMonitor (_Jv_Mutex_t *mu) ...@@ -114,7 +114,9 @@ _Jv_PthreadCheckMonitor (_Jv_Mutex_t *mu)
// On Linux we exploit knowledge of the implementation. // On Linux we exploit knowledge of the implementation.
int r = pmu->m_count == 1; int r = pmu->m_count == 1;
#elif defined (PTHREAD_MUTEX_HAVE___M_COUNT) #elif defined (PTHREAD_MUTEX_HAVE___M_COUNT)
int r = (pthread_t) pmu->__m_owner == pthread_self (); // In glibc 2.1, the first time the mutex is grabbed __m_count is
// set to 0 and __m_owner is set to pthread_self().
int r = ! pmu->__m_count;
#else #else
int r = mu->count == 0; int r = mu->count == 0;
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment