This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [RFC PATCH glibc] pthread_setspecific: Provide signal-safety across keys
On Tue, 17 Oct 2017, Mathieu Desnoyers wrote:
> @c pthread_setspecific @asucorrupt @ascuheap @acucorrupt @acsmem
> @c a level2 block may be allocated by a signal handler after
> @c another call already made a decision to allocate it, thus losing
> @c the allocated value. the seq number is updated before the
> @c value, which might cause an earlier-generation value to seem
> @c current if setspecific is cancelled or interrupted by a signal
> @c KEY_UNUSED ok
> @c calloc dup @ascuheap @acsmem
> Associate the thread-specific @var{value} with @var{key} in the calling thread.
> @end deftypefun
>
> We'd need to edit the part about level2 block and allocation.
That part is *comments* explaining to people reading the manual source
code why the particular user-visible @safety{} annotations were determined
from the library sources.
It's true we should keep those up to date when the library sources change.
But my point was that there should be *user-visible* documentation - not
just comments in the manual sources - of any safety guarantees we choose
to provide beyond POSIX.
--
Joseph S. Myers
joseph@codesourcery.com