glibc/include/pthread.h
Adhemerval Zanella f779b1efb3 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.
2021-06-09 15:16:45 -03:00

25 lines
811 B
C

#include_next <pthread.h>
#ifndef _ISOMAC
/* Prototypes repeated instead of using __typeof because pthread.h is
included in C++ tests, and declaring functions with __typeof and
__THROW doesn't work for C++. */
extern int __pthread_barrier_init (pthread_barrier_t *__restrict __barrier,
const pthread_barrierattr_t *__restrict
__attr, unsigned int __count)
__THROW __nonnull ((1));
#if PTHREAD_IN_LIBC
libc_hidden_proto (__pthread_barrier_init)
#endif
extern int __pthread_barrier_wait (pthread_barrier_t *__barrier)
__THROWNL __nonnull ((1));
/* This function is called to initialize the pthread library. */
extern void __pthread_initialize (void) __attribute__ ((weak));
extern int __pthread_kill (pthread_t threadid, int signo);
extern pthread_t __pthread_self (void);
#endif