X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fthread%2Fsynccall.c;h=c414990445bc65a415db8251118858e50e15f1b9;hb=83dc6eb087633abcf5608ad651d3b525ca2ec35e;hp=a21578dc5745ca8467309755189c6aefb9887aed;hpb=4c48501ee2a022a0dd207a2db4d346a00f9927a1;p=musl diff --git a/src/thread/synccall.c b/src/thread/synccall.c index a21578dc..c4149904 100644 --- a/src/thread/synccall.c +++ b/src/thread/synccall.c @@ -1,5 +1,6 @@ #include "pthread_impl.h" #include +#include static struct chain { struct chain *next; @@ -13,12 +14,11 @@ static sem_t chainlock, chaindone; static void handler(int sig, siginfo_t *si, void *ctx) { struct chain ch; - pthread_t self = __pthread_self(); int old_errno = errno; if (chainlen == libc.threads_minus_1) return; - sigqueue(self->pid, SIGSYNCCALL, (union sigval){0}); + sigqueue(getpid(), SIGSYNCCALL, (union sigval){0}); sem_init(&ch.sem, 0, 0); sem_init(&ch.sem2, 0, 0); @@ -39,7 +39,6 @@ static void handler(int sig, siginfo_t *si, void *ctx) void __synccall(void (*func)(void *), void *ctx) { - pthread_t self; struct sigaction sa; struct chain *next; sigset_t oldmask; @@ -65,8 +64,7 @@ void __synccall(void (*func)(void *), void *ctx) sigfillset(&sa.sa_mask); __libc_sigaction(SIGSYNCCALL, &sa, 0); - self = __pthread_self(); - sigqueue(self->pid, SIGSYNCCALL, (union sigval){0}); + sigqueue(getpid(), SIGSYNCCALL, (union sigval){0}); while (sem_wait(&chaindone)); sa.sa_flags = 0;