This is the mail archive of the java-patches@sourceware.cygnus.com mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Patch: yet another pthreads patch


Here's my hopefully final pthreads test patch.

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.

Tom

Index: include/posix-threads.h
===================================================================
RCS file: /cvs/java/libgcj/libjava/include/posix-threads.h,v
retrieving revision 1.6
diff -u -r1.6 posix-threads.h
--- posix-threads.h	1999/09/08 07:01:32	1.6
+++ posix-threads.h	1999/09/08 17:07:16
@@ -114,7 +114,9 @@
   // 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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]