From 9a7178d611c8a9b2089cbd8288b623ec3e86da3f Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 1 May 2003 23:19:51 +0000 Subject: Update. 2003-05-01 Ulrich Drepper * 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. --- nptl/pthread_mutex_lock.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'nptl/pthread_mutex_lock.c') diff --git a/nptl/pthread_mutex_lock.c b/nptl/pthread_mutex_lock.c index 5040232cf0..f70445acfc 100644 --- a/nptl/pthread_mutex_lock.c +++ b/nptl/pthread_mutex_lock.c @@ -26,14 +26,14 @@ int __pthread_mutex_lock (mutex) pthread_mutex_t *mutex; { - struct pthread *pd = THREAD_SELF; + struct pthread *id = THREAD_ID; switch (__builtin_expect (mutex->__data.__kind, PTHREAD_MUTEX_TIMED_NP)) { /* Recursive mutex. */ case PTHREAD_MUTEX_RECURSIVE_NP: /* Check whether we already hold the mutex. */ - if (mutex->__data.__owner == pd) + if (mutex->__data.__owner == id) { /* Just bump the counter. */ if (__builtin_expect (mutex->__data.__count + 1 == 0, 0)) @@ -48,7 +48,7 @@ __pthread_mutex_lock (mutex) lll_mutex_lock (mutex->__data.__lock); /* Record the ownership. */ - mutex->__data.__owner = pd; + mutex->__data.__owner = id; mutex->__data.__count = 1; } break; @@ -56,7 +56,7 @@ __pthread_mutex_lock (mutex) /* Error checking mutex. */ case PTHREAD_MUTEX_ERRORCHECK_NP: /* Check whether we already hold the mutex. */ - if (mutex->__data.__owner == pd) + if (mutex->__data.__owner == id) return EDEADLK; /* FALLTHROUGH */ @@ -68,7 +68,7 @@ __pthread_mutex_lock (mutex) /* Normal mutex. */ lll_mutex_lock (mutex->__data.__lock); /* Record the ownership. */ - mutex->__data.__owner = pd; + mutex->__data.__owner = id; break; } -- cgit v1.2.1