This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[review v3] nptl: Add struct_mutex.h
- From: "Florian Weimer (Code Review)" <gerrit at gnutoolchain-gerrit dot osci dot io>
- To: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>, libc-alpha at sourceware dot org
- Cc: Florian Weimer <fweimer at redhat dot com>
- Date: Fri, 22 Nov 2019 09:30:40 -0500
- Subject: [review v3] nptl: Add struct_mutex.h
- Auto-submitted: auto-generated
- References: <gerrit.1573136666000.I30a22c3e3497805fd6e52994c5925897cffcfe13@gnutoolchain-gerrit.osci.io>
- Reply-to: gnutoolchain-gerrit at osci dot io
Florian Weimer has posted comments on this change.
Change URL: https://gnutoolchain-gerrit.osci.io/r/c/glibc/+/518
......................................................................
Patch Set 3: Code-Review+2
(2 comments)
| --- /dev/null
| +++ sysdeps/nptl/bits/mutex-internal.h
PS1:
Done
| --- /dev/null
| +++ sysdeps/nptl/bits/struct_mutex.h
| @@ -1,0 +41,20 @@ #endif
| +
| + After a mutex has been initialized, the __kind of a mutex is usually not
| + changed. BUT it can be set to -1 in pthread_mutex_destroy or elision can
| + be enabled. This is done concurrently in the pthread_mutex_*lock
| + functions by using the macro FORCE_ELISION. This macro is only defined
| + for architectures which supports lock elision.
| +
| + For elision, there are the flags PTHREAD_MUTEX_ELISION_NP and
| + PTHREAD_MUTEX_NO_ELISION_NP which can be set in addition to the already
| + set type of a mutex. Before a mutex is initialized, only
| + PTHREAD_MUTEX_NO_ELISION_NP can be set with pthread_mutexattr_settype.
PS2, Line 51:
Ack
| +
| + After a mutex has been initialized, the functions pthread_mutex_*lock can
| + enable elision - if the mutex-type and the machine supports it - by
| + setting the flag PTHREAD_MUTEX_ELISION_NP. This is done concurrently.
| + Afterwards the lock / unlock functions are using specific elision
| + code-paths. */
| + int __kind;
| +#if __WORDSIZE != 64
| + unsigned int __nusers;
--
Gerrit-Project: glibc
Gerrit-Branch: master
Gerrit-Change-Id: I30a22c3e3497805fd6e52994c5925897cffcfe13
Gerrit-Change-Number: 518
Gerrit-PatchSet: 3
Gerrit-Owner: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Gerrit-Reviewer: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Gerrit-Reviewer: Florian Weimer <fweimer@redhat.com>
Gerrit-Comment-Date: Fri, 22 Nov 2019 14:30:40 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Florian Weimer <fweimer@redhat.com>
Comment-In-Reply-To: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Gerrit-MessageType: comment