about summary refs log tree commit diff
path: root/src/thread/pthread_cancel.c
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2011-03-29 12:58:22 -0400
committerRich Felker <dalias@aerifal.cx>2011-03-29 12:58:22 -0400
commitbf619d82c82052741323aa63c107fbd346c8aaba (patch)
tree11f97d73195bb633df6c6e679ab65a7f8f0fd477 /src/thread/pthread_cancel.c
parent70c31c7bd779400d2eb56dcb4075bb37227081db (diff)
downloadmusl-bf619d82c82052741323aa63c107fbd346c8aaba.tar.gz
musl-bf619d82c82052741323aa63c107fbd346c8aaba.tar.xz
musl-bf619d82c82052741323aa63c107fbd346c8aaba.zip
major improvements to cancellation handling
- there is no longer any risk of spoofing cancellation requests, since
  the cancel flag is set in pthread_cancel rather than in the signal
  handler.

- cancellation signal is no longer unblocked when running the
  cancellation handlers. instead, pthread_create will cause any new
  threads created from a cancellation handler to unblock their own
  cancellation signal.

- various tweaks in preparation for POSIX timer support.
Diffstat (limited to 'src/thread/pthread_cancel.c')
-rw-r--r--src/thread/pthread_cancel.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/thread/pthread_cancel.c b/src/thread/pthread_cancel.c
index 9f7829e6..1ff00ad3 100644
--- a/src/thread/pthread_cancel.c
+++ b/src/thread/pthread_cancel.c
@@ -2,5 +2,6 @@
 
 int pthread_cancel(pthread_t t)
 {
+	t->cancel = 1;
 	return pthread_kill(t, SIGCANCEL);
 }