This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[review v3] nptl: Add struct_mutex.h


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]