From 1717da59aed9612becd56aaa1249aac695af4c8a Mon Sep 17 00:00:00 2001 From: Andi Kleen Date: Thu, 16 May 2013 19:17:14 -0700 Subject: Add a configure option to enable lock elision and disable by default Can be enabled with --enable-lock-elision=yes at configure time. --- nptl/ChangeLog | 5 +++++ nptl/sysdeps/unix/sysv/linux/x86/elision-conf.c | 3 +++ 2 files changed, 8 insertions(+) (limited to 'nptl') diff --git a/nptl/ChangeLog b/nptl/ChangeLog index d32046ee65..46cf30849f 100644 --- a/nptl/ChangeLog +++ b/nptl/ChangeLog @@ -1,3 +1,8 @@ +2013-07-02 Andi Kleen + + * sysdeps/unix/sysv/linux/x86/elision-conf.c (elision_init): + Check ENABLE_LOCK_ELISION. + 2013-07-02 Andi Kleen * pthread_mutexattr_settype.c (__pthread_mutexattr_settype): diff --git a/nptl/sysdeps/unix/sysv/linux/x86/elision-conf.c b/nptl/sysdeps/unix/sysv/linux/x86/elision-conf.c index 6277e48d76..118cfa72f5 100644 --- a/nptl/sysdeps/unix/sysv/linux/x86/elision-conf.c +++ b/nptl/sysdeps/unix/sysv/linux/x86/elision-conf.c @@ -16,6 +16,7 @@ License along with the GNU C Library; if not, see . */ +#include "config.h" #include #include #include @@ -70,8 +71,10 @@ elision_init (int argc __attribute__ ((unused)), char **environ) { __elision_available = HAS_RTM; +#ifdef ENABLE_LOCK_ELISION __pthread_force_elision = __libc_enable_secure ? 0 : __elision_available; __rwlock_rtm_enabled = __libc_enable_secure ? 0 : __elision_available; +#endif } #ifdef SHARED -- cgit 1.4.1