From 5a8075b116280d0c1ece277e4be75250efca45b2 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 23 May 2007 20:51:45 +0000 Subject: * init.c (__pthread_initialize_minimal_internal): Check whether private futexes are available. * allocatestack.c (allocate_stack): Copy private_futex field from current thread into the new stack. * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Use private futexes if they are available. * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Adjust so that change in libc-lowlevellock.S allow using private futexes. * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise. * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Define FUTEX_PRIVATE_FLAG. * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise. * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Use private futexes if they are available. * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise. * sysdeps/x86_64/tcb-offsets.sym: Add PRIVATE_FUTEX. * sysdeps/i386/tcb-offsets.sym: Likewise. * sysdeps/x86_64/tls.h (tcbhead_t): Add private_futex field. * sysdeps/i386/tls.h (tcbhead_t): Likewise. --- nptl/sysdeps/x86_64/tcb-offsets.sym | 3 +++ nptl/sysdeps/x86_64/tls.h | 4 ++++ 2 files changed, 7 insertions(+) (limited to 'nptl/sysdeps/x86_64') diff --git a/nptl/sysdeps/x86_64/tcb-offsets.sym b/nptl/sysdeps/x86_64/tcb-offsets.sym index 21274ec..1c70c6b 100644 --- a/nptl/sysdeps/x86_64/tcb-offsets.sym +++ b/nptl/sysdeps/x86_64/tcb-offsets.sym @@ -12,3 +12,6 @@ MUTEX_FUTEX offsetof (pthread_mutex_t, __data.__lock) MULTIPLE_THREADS_OFFSET offsetof (tcbhead_t, multiple_threads) POINTER_GUARD offsetof (tcbhead_t, pointer_guard) VGETCPU_CACHE_OFFSET offsetof (tcbhead_t, vgetcpu_cache) +#ifndef __ASSUME_PRIVATE_FUTEX +PRIVATE_FUTEX offsetof (tcbhead_t, private_futex) +#endif diff --git a/nptl/sysdeps/x86_64/tls.h b/nptl/sysdeps/x86_64/tls.h index 3a69e04..5ddaafa 100644 --- a/nptl/sysdeps/x86_64/tls.h +++ b/nptl/sysdeps/x86_64/tls.h @@ -27,6 +27,7 @@ # include # include # include +# include /* Type for the dtv. */ @@ -53,6 +54,9 @@ typedef struct uintptr_t stack_guard; uintptr_t pointer_guard; unsigned long int vgetcpu_cache[2]; +#ifndef __ASSUME_PRIVATE_FUTEX + int private_futex; +#endif } tcbhead_t; #else /* __ASSEMBLER__ */ -- cgit v1.1