posix-threads.h (_Jv_PthreadCheckMonitor): Reverted previous change and implemented...
authorTom Tromey <tromey@cygnus.com>
Wed, 8 Sep 1999 17:10:22 +0000 (17:10 +0000)
committerTom Tromey <tromey@gcc.gnu.org>
Wed, 8 Sep 1999 17:10:22 +0000 (17:10 +0000)
* include/posix-threads.h (_Jv_PthreadCheckMonitor): Reverted
previous change and implemented a correct test in the __m_count
case.

From-SVN: r29209

libjava/ChangeLog
libjava/include/posix-threads.h

index 9d60804091803abd75b027a960162a42b3870f32..5092814932abff291cb6c7a268573d10fbd72d92 100644 (file)
@@ -1,5 +1,9 @@
 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
        in __m_count case.
 
index 00a918fab279764feeae324cc8d4e261b94838b7..38629f44b010a9361b90635d09d3ead376048f9f 100644 (file)
@@ -114,7 +114,9 @@ _Jv_PthreadCheckMonitor (_Jv_Mutex_t *mu)
   // On Linux we exploit knowledge of the implementation.
   int r = pmu->m_count == 1;
 #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
   int r = mu->count == 0;
 #endif