提交 73db33b9 编写于 作者: R Rich Felker

remove leftover cp_sp cruft from cancellation code, fix small bug

the bug was that cancellation requests which arrived while a
cancellation point was interrupted by a signal handler would not be
acted upon when the signal handler returns. this was because cp_sp was
never set; it's no longer needed or used.

instead, just always re-raise the signal when cancellation was not
acted upon. this wastes a tiny amount of time in the rare case where
it even matters, but it ensures correctness and simplifies the code.
上级 54c56764
......@@ -3,7 +3,6 @@
void __cancel()
{
pthread_t self = __pthread_self();
self->cp_sp = 0;
self->canceldisable = 1;
self->cancelasync = 0;
pthread_exit(PTHREAD_CANCELED);
......@@ -48,8 +47,7 @@ static void cancel_handler(int sig, siginfo_t *si, void *ctx)
__cancel();
}
if (self->cp_sp)
__syscall(SYS_tgkill, self->pid, self->tid, SIGCANCEL);
__syscall(SYS_tgkill, self->pid, self->tid, SIGCANCEL);
}
void __testcancel()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册