Use pthread_equal rather than != to compare thread IDs.
authorgandalf <gandalf@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 13 Mar 2013 21:21:27 +0000 (21:21 +0000)
committergandalf <gandalf@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 13 Mar 2013 21:21:27 +0000 (21:21 +0000)
2013-03-12  Andrew John Hughes  <gnu.andrew@redhat.com>

* include/posix-threads.h:
(_Jv_MutexCheckMonitor(_Jv_Mutex_t)): Use
pthread_equal rather than !=.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@196639 138bc75d-0d04-0410-961f-82ee72b054a4

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

index d5f508d..7ad315e 100644 (file)
@@ -1,3 +1,9 @@
+2013-03-12  Andrew John Hughes  <gnu.andrew@redhat.com>
+
+       * include/posix-threads.h:
+       (_Jv_MutexCheckMonitor(_Jv_Mutex_t)): Use
+       pthread_equal rather than !=.
+
 2013-01-07  H.J. Lu  <hongjiu.lu@intel.com>
 
        * Makefile.am (lib_gnu_awt_xlib_la_LDFLAGS): Replace
index 59e65f7..1ec311d 100644 (file)
@@ -79,7 +79,7 @@ typedef struct
 inline int
 _Jv_MutexCheckMonitor (_Jv_Mutex_t *mu)
 {
-  return (mu->owner != pthread_self());
+  return (pthread_equal(mu->owner, pthread_self()) == 0);
 }
 
 // Type identifying a POSIX thread.