diff options
author | Andi Kleen <ak@linux.intel.com> | 2012-12-22 00:58:34 -0800 |
---|---|---|
committer | Andi Kleen <ak@linux.intel.com> | 2013-07-02 08:46:54 -0700 |
commit | b023e4ca99f5e81f90d87d23cd267ef2abd2388c (patch) | |
tree | 6fd6b77bef5574ee6fa5aa44967766b018d3b489 /nptl/pthreadP.h | |
parent | 1cdbe579482c07e9f4bb3baa4864da2d3e7eb837 (diff) | |
download | glibc-b023e4ca99f5e81f90d87d23cd267ef2abd2388c.tar.gz glibc-b023e4ca99f5e81f90d87d23cd267ef2abd2388c.tar.xz glibc-b023e4ca99f5e81f90d87d23cd267ef2abd2388c.zip |
Add new internal mutex type flags for elision.
Add Enable/disable flags used internally Extend the mutex initializers to have the fields needed for elision. The layout stays the same, and this is not visible to programs. These changes are not exposed outside pthread
Diffstat (limited to 'nptl/pthreadP.h')
-rw-r--r-- | nptl/pthreadP.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h index 7883fdfa10..e6b80bfd6e 100644 --- a/nptl/pthreadP.h +++ b/nptl/pthreadP.h @@ -61,6 +61,10 @@ enum { PTHREAD_MUTEX_KIND_MASK_NP = 3, + + PTHREAD_MUTEX_ELISION_NP = 256, + PTHREAD_MUTEX_NO_ELISION_NP = 512, + PTHREAD_MUTEX_ROBUST_NORMAL_NP = 16, PTHREAD_MUTEX_ROBUST_RECURSIVE_NP = PTHREAD_MUTEX_ROBUST_NORMAL_NP | PTHREAD_MUTEX_RECURSIVE_NP, @@ -93,12 +97,21 @@ enum PTHREAD_MUTEX_PP_ERRORCHECK_NP = PTHREAD_MUTEX_PRIO_PROTECT_NP | PTHREAD_MUTEX_ERRORCHECK_NP, PTHREAD_MUTEX_PP_ADAPTIVE_NP - = PTHREAD_MUTEX_PRIO_PROTECT_NP | PTHREAD_MUTEX_ADAPTIVE_NP + = PTHREAD_MUTEX_PRIO_PROTECT_NP | PTHREAD_MUTEX_ADAPTIVE_NP, + PTHREAD_MUTEX_ELISION_FLAGS_NP + = PTHREAD_MUTEX_ELISION_NP | PTHREAD_MUTEX_NO_ELISION_NP, + + PTHREAD_MUTEX_TIMED_ELISION_NP = + PTHREAD_MUTEX_TIMED_NP | PTHREAD_MUTEX_ELISION_NP, + PTHREAD_MUTEX_TIMED_NO_ELISION_NP = + PTHREAD_MUTEX_TIMED_NP | PTHREAD_MUTEX_NO_ELISION_NP, }; #define PTHREAD_MUTEX_PSHARED_BIT 128 #define PTHREAD_MUTEX_TYPE(m) \ ((m)->__data.__kind & 127) +#define PTHREAD_MUTEX_TYPE_ELISION(m) \ + ((m)->__data.__kind & (127|PTHREAD_MUTEX_ELISION_FLAGS_NP)) #if LLL_PRIVATE == 0 && LLL_SHARED == 128 # define PTHREAD_MUTEX_PSHARED(m) \ |