nptl: Implement raise in terms of pthread_kill
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Mon, 7 Dec 2020 19:21:55 +0000 (16:21 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Wed, 9 Jun 2021 18:16:45 +0000 (15:16 -0300)
commitf779b1efb35fe141e47952af3ac7f0540acca401
treec85d1e5a2b7f93048159938802f187d98a1b8d09
parent8c1c0aae2079039a629b15098d78f3d11aabefb4
nptl: Implement raise in terms of pthread_kill

Now that pthread_kill is provided by libc.so it is possible to
implement the generic POSIX implementation as
'pthread_kill(pthread_self(), sig)'.

For Linux implementation, pthread_kill read the targeting TID from
the TCB.  For raise, this it not possible because it would make raise
fail when issue after vfork (where creates the resulting process
has a different TID from the parent, but its TCB is not updated as
for pthread_create).  To make raise use pthread_kill, it is make
usable from vfork by getting the target thread id through gettid
syscall.

Checked on x86_64-linux-gnu and aarch64-linux-gnu.
include/pthread.h
nptl/Makefile
nptl/pthreadP.h
nptl/pthread_kill.c
nptl/pthread_self.c
sysdeps/htl/pthreadP.h
sysdeps/posix/raise.c
sysdeps/unix/sysv/linux/raise.c [deleted file]