This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Don't do lock elision on an error checking mutex (bug 17514)
- From: Aurelien Jarno <aurelien at aurel32 dot net>
- To: Andreas Schwab <schwab at suse dot de>
- Cc: Florian Weimer <fweimer at redhat dot com>, libc-alpha at sourceware dot org
- Date: Sat, 23 Jan 2016 22:59:42 +0100
- Subject: Re: [PATCH] Don't do lock elision on an error checking mutex (bug 17514)
- Authentication-results: sourceware.org; auth=none
- References: <mvma8o8qz1c dot fsf at hawking dot suse dot de> <569780B3 dot 5020504 at redhat dot com> <mvmlh7spei3 dot fsf at hawking dot suse dot de>
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