about summary refs log tree commit diff
path: root/nptl/sysdeps/pthread/pthread_rwlock_timedrdlock.c
diff options
context:
space:
mode:
Diffstat (limited to 'nptl/sysdeps/pthread/pthread_rwlock_timedrdlock.c')
-rw-r--r--nptl/sysdeps/pthread/pthread_rwlock_timedrdlock.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/nptl/sysdeps/pthread/pthread_rwlock_timedrdlock.c b/nptl/sysdeps/pthread/pthread_rwlock_timedrdlock.c
index d5a75ba3b2..2cba0d3c88 100644
--- a/nptl/sysdeps/pthread/pthread_rwlock_timedrdlock.c
+++ b/nptl/sysdeps/pthread/pthread_rwlock_timedrdlock.c
@@ -58,9 +58,8 @@ pthread_rwlock_timedrdlock (rwlock, abstime)
 
       /* Make sure we are not holding the rwlock as a writer.  This is
 	 a deadlock situation we recognize and report.  */
-      if (rwlock->__data.__writer != 0
-	  && __builtin_expect (rwlock->__data.__writer
-			       == (pthread_t) THREAD_ID, 0))
+      if (__builtin_expect (rwlock->__data.__writer
+			    == THREAD_GETMEM (THREAD_SELF, tid), 0))
 	{
 	  result = EDEADLK;
 	  break;