From 8491ed6d70b60e4c75cdcfde10ae759898547b08 Mon Sep 17 00:00:00 2001 From: Andi Kleen Date: Mon, 31 Mar 2014 08:07:46 -0700 Subject: Add adaptive elision to rwlocks This patch relies on the C version of the rwlocks posted earlier. With C rwlocks it is very straight forward to do adaptive elision using TSX. It is based on the infrastructure added earlier for mutexes, but uses its own elision macros. The macros are fairly general purpose and could be used for other elision purposes too. This version is much cleaner than the earlier assembler based version, and in particular implements adaptation which makes it safer. I changed the behavior slightly to not require any changes in the test suite and fully conform to all expected behaviors (generally at the cost of not eliding in various situations). In particular this means the timedlock variants are not elided. Nested trylock aborts. --- sysdeps/sh/nptl/bits/pthreadtypes.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sysdeps/sh') diff --git a/sysdeps/sh/nptl/bits/pthreadtypes.h b/sysdeps/sh/nptl/bits/pthreadtypes.h index a177f28347..363a94848c 100644 --- a/sysdeps/sh/nptl/bits/pthreadtypes.h +++ b/sysdeps/sh/nptl/bits/pthreadtypes.h @@ -155,6 +155,8 @@ typedef union long int __align; } pthread_rwlock_t; +#define __PTHREAD_RWLOCK_ELISION_EXTRA 0 + typedef union { char __size[__SIZEOF_PTHREAD_RWLOCKATTR_T]; -- cgit 1.4.1