This is the mail archive of the
mailing list for the glibc project.
Re: [PATCH] Make pthread_getspecific async-signal-safe
- From: Roland McGrath <roland at hack dot frob dot com>
- To: Andrew Hunter <ahh at google dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>, Paul Pluzhnikov <ppluzhnikov at google dot com>
- Date: Tue, 16 Dec 2014 12:31:28 -0800 (PST)
- Subject: Re: [PATCH] Make pthread_getspecific async-signal-safe
- Authentication-results: sourceware.org; auth=none
- References: <1418756227-17380-1-git-send-email-ahh at google dot com> <CADroS=4w2E5u5iCmoANFy=QeHMy8wP2VxfCh9QustDTdisw2Jw at mail dot gmail dot com>
I think we might be open to declaring pthread_getspecific async-signal-safe
as a GNU extension. If we do this, we need to make the manual say very
explicitly that we're offering this guarantee as part of the glibc API even
though it is not guaranteed by POSIX. So please include such wording
changes to manual/threads.texi in your patch.
The code change itself needs thorough comments explaining what constraints
the code is (newly) under and exactly what, why, and how it is doing to
The test program has some common style errors: missing descriptive comment
in top line; two spaces after a period in comments; space before paren in
function calls; space after cast.
It's also generally bad form to write code so important side effects are in
assert, even though it's not a semantic error in the context of libc tests
since we'll never build them with -DNDEBUG.
The test could use some comments about the logic of what it's testing.