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);
__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();
}