X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fthread%2Fcancel_impl.c;h=069b27962ac1b56f0e55b693742e7a04d7209690;hb=83dc6eb087633abcf5608ad651d3b525ca2ec35e;hp=c835813a30f02f0943c86301ead0b19ef15957da;hpb=d8b587796f7cfa0c3aa780ad19afe2e30ce84a09;p=musl diff --git a/src/thread/cancel_impl.c b/src/thread/cancel_impl.c index c835813a..069b2796 100644 --- a/src/thread/cancel_impl.c +++ b/src/thread/cancel_impl.c @@ -20,7 +20,7 @@ long (__syscall_cp)(syscall_arg_t nr, pthread_t self; long r; - if (!libc.main_thread || (self = __pthread_self())->canceldisable) + if (!libc.has_thread_pointer || (self = __pthread_self())->canceldisable) return __syscall(nr, u, v, w, x, y, z); r = __syscall_cp_asm(&self->cancel, nr, u, v, w, x, y, z); @@ -52,12 +52,13 @@ static void cancel_handler(int sig, siginfo_t *si, void *ctx) __cancel(); } - __syscall(SYS_tgkill, self->pid, self->tid, SIGCANCEL); + __syscall(SYS_tkill, self->tid, SIGCANCEL); } void __testcancel() { - pthread_t self = pthread_self(); + if (!libc.has_thread_pointer) return; + pthread_t self = __pthread_self(); if (self->cancel && !self->canceldisable) __cancel(); }