]> git.ipfire.org Git - thirdparty/glibc.git/commit
nptl: Fix race between pthread_kill and thread exit (bug 12889)
authorFlorian Weimer <fweimer@redhat.com>
Mon, 13 Sep 2021 09:06:08 +0000 (11:06 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Mon, 13 Sep 2021 11:38:51 +0000 (13:38 +0200)
commita8ac8c4725ddb1119764126a8674a04c9dd5aea8
tree36ecdff12d461ddc76964e1bd88ac18c71d000dc
parent3abf3bd4edc86fb28c099cc85203cb46a811e0b8
nptl: Fix race between pthread_kill and thread exit (bug 12889)

A new thread exit lock and flag are introduced.  They are used to
detect that the thread is about to exit or has exited in
__pthread_kill_internal, and the signal is not sent in this case.

The test sysdeps/pthread/tst-pthread_cancel-select-loop.c is derived
from a downstream test originally written by Marek Polacek.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
(cherry picked from commit 526c3cf11ee9367344b6b15d669e4c3cb461a2be)
NEWS
nptl/allocatestack.c
nptl/descr.h
nptl/pthread_create.c
nptl/pthread_kill.c
sysdeps/pthread/Makefile
sysdeps/pthread/tst-pthread_cancel-select-loop.c [new file with mode: 0644]
sysdeps/pthread/tst-pthread_kill-exiting.c [new file with mode: 0644]