about summary refs log tree commit diff
path: root/nptl/sysdeps/pthread
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-05-01 23:19:51 +0000
committerUlrich Drepper <drepper@redhat.com>2003-05-01 23:19:51 +0000
commit9a7178d611c8a9b2089cbd8288b623ec3e86da3f (patch)
treeb33e5f3f63e777a1939eebcf23ee7351043861a8 /nptl/sysdeps/pthread
parentcf20f569ae3e9c1893a45b58f5181ed336ca1c4d (diff)
downloadglibc-9a7178d611c8a9b2089cbd8288b623ec3e86da3f.tar.gz
glibc-9a7178d611c8a9b2089cbd8288b623ec3e86da3f.tar.xz
glibc-9a7178d611c8a9b2089cbd8288b623ec3e86da3f.zip
Update.
2003-05-01  Ulrich Drepper  <drepper@redhat.com>

	* sysdeps/i386/tls.h: Define THREAD_ID.
	* sysdeps/ia64/tls.h: Likewise.
	* sysdeps/powerpc/tls.h: Likewise.
	* sysdeps/s390/tls.h: Likewise.
	* sysdeps/sh/tls.h: Likewise.
	* sysdeps/x86_64/tls.h: Likewise.
	* pthread_mutex_lock.c: Use THREAD_ID instead of THREAD_SELF to
	record ownership.
	* pthread_mutex_timedlock.c: Likewise.
	* pthread_mutex_trylock.c: Likewise.
	* pthread_mutex_unlock.c: Likewise.
	* pthread_rwlock_trywrlock.c: Likewise.
	* sysdeps/pthread/pthread_rwlocklock_rdlock.c: Likewise.
	* sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
	* sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
	* sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.

	* sysdeps/pthread/createthread.c (create_thread): Use CLONE_SYSVSEM
	flag.
Diffstat (limited to 'nptl/sysdeps/pthread')
-rw-r--r--nptl/sysdeps/pthread/createthread.c8
-rw-r--r--nptl/sysdeps/pthread/pthread_rwlock_rdlock.c2
-rw-r--r--nptl/sysdeps/pthread/pthread_rwlock_timedrdlock.c2
-rw-r--r--nptl/sysdeps/pthread/pthread_rwlock_timedwrlock.c4
-rw-r--r--nptl/sysdeps/pthread/pthread_rwlock_wrlock.c4
5 files changed, 11 insertions, 9 deletions
diff --git a/nptl/sysdeps/pthread/createthread.c b/nptl/sysdeps/pthread/createthread.c
index 9d00e4e135..ea1213896e 100644
--- a/nptl/sysdeps/pthread/createthread.c
+++ b/nptl/sysdeps/pthread/createthread.c
@@ -78,8 +78,9 @@ create_thread (struct pthread *pd, STACK_VARIABLES_PARMS)
 	  if (ARCH_CLONE (start_thread_debug, STACK_VARIABLES_ARGS,
 			  CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGNAL |
 			  CLONE_SETTLS | CLONE_PARENT_SETTID |
-			  CLONE_CHILD_CLEARTID | CLONE_DETACHED | 0,
-			  pd, &pd->tid, TLS_VALUE, &pd->tid) == -1)
+			  CLONE_CHILD_CLEARTID | CLONE_DETACHED |
+			  CLONE_SYSVSEM | 0, pd, &pd->tid, TLS_VALUE,
+			  &pd->tid) == -1)
 	    /* Failed.  */
 	    return errno;
 
@@ -151,7 +152,8 @@ create_thread (struct pthread *pd, STACK_VARIABLES_PARMS)
   if (ARCH_CLONE (start_thread, STACK_VARIABLES_ARGS,
 		  CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGNAL |
 		  CLONE_SETTLS | CLONE_PARENT_SETTID | CLONE_CHILD_CLEARTID |
-		  CLONE_DETACHED | 0, pd, &pd->tid, TLS_VALUE, &pd->tid) == -1)
+		  CLONE_DETACHED | CLONE_SYSVSEM | 0, pd, &pd->tid, TLS_VALUE,
+		  &pd->tid) == -1)
     /* Failed.  */
     return errno;
 
diff --git a/nptl/sysdeps/pthread/pthread_rwlock_rdlock.c b/nptl/sysdeps/pthread/pthread_rwlock_rdlock.c
index 197af9c970..7fb93df1de 100644
--- a/nptl/sysdeps/pthread/pthread_rwlock_rdlock.c
+++ b/nptl/sysdeps/pthread/pthread_rwlock_rdlock.c
@@ -57,7 +57,7 @@ __pthread_rwlock_rdlock (rwlock)
 	 a deadlock situation we recognize and report.  */
       if (rwlock->__data.__writer != 0
 	  && __builtin_expect (rwlock->__data.__writer
-			       == (pthread_t) THREAD_SELF, 0))
+			       == (pthread_t) THREAD_ID, 0))
 	{
 	  result = EDEADLK;
 	  break;
diff --git a/nptl/sysdeps/pthread/pthread_rwlock_timedrdlock.c b/nptl/sysdeps/pthread/pthread_rwlock_timedrdlock.c
index 9c1815570f..d5a75ba3b2 100644
--- a/nptl/sysdeps/pthread/pthread_rwlock_timedrdlock.c
+++ b/nptl/sysdeps/pthread/pthread_rwlock_timedrdlock.c
@@ -60,7 +60,7 @@ pthread_rwlock_timedrdlock (rwlock, abstime)
 	 a deadlock situation we recognize and report.  */
       if (rwlock->__data.__writer != 0
 	  && __builtin_expect (rwlock->__data.__writer
-			       == (pthread_t) THREAD_SELF, 0))
+			       == (pthread_t) THREAD_ID, 0))
 	{
 	  result = EDEADLK;
 	  break;
diff --git a/nptl/sysdeps/pthread/pthread_rwlock_timedwrlock.c b/nptl/sysdeps/pthread/pthread_rwlock_timedwrlock.c
index e4d08ea657..52308aff91 100644
--- a/nptl/sysdeps/pthread/pthread_rwlock_timedwrlock.c
+++ b/nptl/sysdeps/pthread/pthread_rwlock_timedwrlock.c
@@ -43,7 +43,7 @@ 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_SELF;
+	  rwlock->__data.__writer = (pthread_t) THREAD_ID;
 	  break;
 	}
 
@@ -51,7 +51,7 @@ pthread_rwlock_timedwrlock (rwlock, abstime)
 	 a deadlock situation we recognize and report.  */
       if (rwlock->__data.__writer != 0
 	  && __builtin_expect (rwlock->__data.__writer
-			       == (pthread_t) THREAD_SELF, 0))
+			       == (pthread_t) THREAD_ID, 0))
 	{
 	  result = EDEADLK;
 	  break;
diff --git a/nptl/sysdeps/pthread/pthread_rwlock_wrlock.c b/nptl/sysdeps/pthread/pthread_rwlock_wrlock.c
index 03c37a1933..171a14adb1 100644
--- a/nptl/sysdeps/pthread/pthread_rwlock_wrlock.c
+++ b/nptl/sysdeps/pthread/pthread_rwlock_wrlock.c
@@ -40,7 +40,7 @@ __pthread_rwlock_wrlock (rwlock)
       if (rwlock->__data.__writer == 0 && rwlock->__data.__nr_readers == 0)
 	{
 	  /* Mark self as writer.  */
-	  rwlock->__data.__writer = (pthread_t) THREAD_SELF;
+	  rwlock->__data.__writer = (pthread_t) THREAD_ID;
 	  break;
 	}
 
@@ -48,7 +48,7 @@ __pthread_rwlock_wrlock (rwlock)
 	 a deadlock situation we recognize and report.  */
       if (rwlock->__data.__writer != 0
 	  && __builtin_expect (rwlock->__data.__writer
-			       == (pthread_t) THREAD_SELF, 0))
+			       == (pthread_t) THREAD_ID, 0))
 	{
 	  result = EDEADLK;
 	  break;