X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fthread%2Fpthread_kill.c;h=79ddb20978f7513f35789209d3d4b3be13df1a46;hb=85050ac5a2677a8ebf2722e93b5c037ec675c036;hp=446254b685721085ce893deb125d72393cedcc6d;hpb=7cc9496a18c3fa665c286b8be41d790c795e0171;p=musl diff --git a/src/thread/pthread_kill.c b/src/thread/pthread_kill.c index 446254b6..79ddb209 100644 --- a/src/thread/pthread_kill.c +++ b/src/thread/pthread_kill.c @@ -5,7 +5,10 @@ int pthread_kill(pthread_t t, int sig) { int r; sigset_t set; - __block_app_sigs(&set); + /* Block not just app signals, but internal ones too, since + * pthread_kill is used to implement pthread_cancel, which + * must be async-cancel-safe. */ + __block_all_sigs(&set); LOCK(t->killlock); r = t->tid ? -__syscall(SYS_tkill, t->tid, sig) : (sig+0U >= _NSIG ? EINVAL : 0);