diff options
authorRich Felker <>2012-05-25 00:35:09 -0400
committerRich Felker <>2012-05-25 00:35:09 -0400
commit73db33b94927d160f5dac5861a37ffbfd81d3ff6 (patch)
parent54c567649eaadb99175b3883659872f791e482b1 (diff)
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.
1 files changed, 1 insertions, 3 deletions
diff --git a/src/thread/cancel_impl.c b/src/thread/cancel_impl.c
index 3bf1e392..a1648982 100644
--- a/src/thread/cancel_impl.c
+++ b/src/thread/cancel_impl.c
@@ -3,7 +3,6 @@
void __cancel()
pthread_t self = __pthread_self();
- self->cp_sp = 0;
self->canceldisable = 1;
self->cancelasync = 0;
@@ -48,8 +47,7 @@ static void cancel_handler(int sig, siginfo_t *si, void *ctx)
- if (self->cp_sp)
- __syscall(SYS_tgkill, self->pid, self->tid, SIGCANCEL);
+ __syscall(SYS_tgkill, self->pid, self->tid, SIGCANCEL);
void __testcancel()