about summary refs log tree commit diff
path: root/nptl/sysdeps/pthread
diff options
context:
space:
mode:
Diffstat (limited to 'nptl/sysdeps/pthread')
-rw-r--r--nptl/sysdeps/pthread/pthread_rwlock_rdlock.c5
-rw-r--r--nptl/sysdeps/pthread/pthread_rwlock_timedrdlock.c5
-rw-r--r--nptl/sysdeps/pthread/pthread_rwlock_timedwrlock.c7
-rw-r--r--nptl/sysdeps/pthread/pthread_rwlock_wrlock.c7
4 files changed, 10 insertions, 14 deletions
diff --git a/nptl/sysdeps/pthread/pthread_rwlock_rdlock.c b/nptl/sysdeps/pthread/pthread_rwlock_rdlock.c
index 7fb93df1de..f785bb7893 100644
--- a/nptl/sysdeps/pthread/pthread_rwlock_rdlock.c
+++ b/nptl/sysdeps/pthread/pthread_rwlock_rdlock.c
@@ -55,9 +55,8 @@ __pthread_rwlock_rdlock (rwlock)
 
       /* 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;
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;
diff --git a/nptl/sysdeps/pthread/pthread_rwlock_timedwrlock.c b/nptl/sysdeps/pthread/pthread_rwlock_timedwrlock.c
index 52308aff91..a3cdda30bb 100644
--- a/nptl/sysdeps/pthread/pthread_rwlock_timedwrlock.c
+++ b/nptl/sysdeps/pthread/pthread_rwlock_timedwrlock.c
@@ -43,15 +43,14 @@ pthread_rwlock_timedwrlock (rwlock, abstime)
       if (rwlock->__data.__writer == 0 && rwlock->__data.__nr_readers == 0)
 	{
 	  /* Mark self as writer.  */
-	  rwlock->__data.__writer = (pthread_t) THREAD_ID;
+	  rwlock->__data.__writer = THREAD_GETMEM (THREAD_SELF, tid);
 	  break;
 	}
 
       /* 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;
diff --git a/nptl/sysdeps/pthread/pthread_rwlock_wrlock.c b/nptl/sysdeps/pthread/pthread_rwlock_wrlock.c
index 171a14adb1..822aeed79c 100644
--- a/nptl/sysdeps/pthread/pthread_rwlock_wrlock.c
+++ b/nptl/sysdeps/pthread/pthread_rwlock_wrlock.c
@@ -40,15 +40,14 @@ __pthread_rwlock_wrlock (rwlock)
       if (rwlock->__data.__writer == 0 && rwlock->__data.__nr_readers == 0)
 	{
 	  /* Mark self as writer.  */
-	  rwlock->__data.__writer = (pthread_t) THREAD_ID;
+	  rwlock->__data.__writer = THREAD_GETMEM (THREAD_SELF, tid);
 	  break;
 	}
 
       /* 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;