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/sysdeps/sh/tls.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'nptl/sysdeps/sh') diff --git a/nptl/sysdeps/sh/tls.h b/nptl/sysdeps/sh/tls.h index 1e27b98..a6cefa0 100644 --- a/nptl/sysdeps/sh/tls.h +++ b/nptl/sysdeps/sh/tls.h @@ -117,6 +117,13 @@ typedef struct __asm ("stc gbr,%0" : "=r" (__self)); \ __self - 1;}) +/* Identifier for the current thread. THREAD_SELF is usable but + sometimes more expensive than necessary as in this case. */ +# define THREAD_ID \ + ({ struct pthread *__self; \ + __asm ("stc gbr,%0" : "=r" (__self)); \ + __self;}) + /* Read member of the thread descriptor directly. */ # define THREAD_GETMEM(descr, member) (descr->member) -- cgit v1.1