[PATCH] Don't do lock elision on an error checking mutex (bug 17514)

Aurelien Jarno aurelien@aurel32.net
Sat Jan 23 21:59:00 GMT 2016


On 2016-01-14 12:49, Andreas Schwab wrote:
> Error checking mutexes are not supposed to be subject to lock elision.
> That would defeat the error checking nature of the mutex because lock
> elision doesn't record ownership.
> 
> 	[BZ #17514]
> 	* nptl/pthread_mutex_timedlock.c (pthread_mutex_timedlock)
> 	<case PTHREAD_MUTEX_ERRORCHECK_NP>: Don't do lock elision.
> 	* nptl/Makefile (tests): Add tst-mutex-errorcheck.
> 	* nptl/tst-mutex-errorcheck.c: New file.
> ---
>  nptl/Makefile                  |  2 +-
>  nptl/pthread_mutex_timedlock.c |  3 ++-
>  nptl/tst-mutex-errorcheck.c    | 58 ++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 61 insertions(+), 2 deletions(-)
>  create mode 100644 nptl/tst-mutex-errorcheck.c

Thanks for the patch. I confirm it fixes the error reported in bugs
nptl/17514 and nptl/19515.

-- 
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
aurelien@aurel32.net                 http://www.aurel32.net



More information about the Libc-alpha mailing list