diff options
author | Rich Felker <dalias@aerifal.cx> | 2016-02-04 22:59:13 +0000 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2016-02-04 22:59:13 +0000 |
commit | aecda35373511c5bf02c0f708bd262adb1a09287 (patch) | |
tree | 932c08f2e997eaebd6ed0667700b8c63041fb6f7 /src | |
parent | 47314f1e6780bd561151c3241d4bcf7b861ed3ee (diff) | |
download | musl-aecda35373511c5bf02c0f708bd262adb1a09287.tar.gz musl-aecda35373511c5bf02c0f708bd262adb1a09287.tar.bz2 musl-aecda35373511c5bf02c0f708bd262adb1a09287.tar.xz musl-aecda35373511c5bf02c0f708bd262adb1a09287.zip |
avoid using signals when a thread attempts to cancel itself
not only is pthread_kill expensive in this case; it also breaks
testing under qemu app-level emulation.
Diffstat (limited to 'src')
-rw-r--r-- | src/thread/pthread_cancel.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/thread/pthread_cancel.c b/src/thread/pthread_cancel.c index a21c3866..3d229223 100644 --- a/src/thread/pthread_cancel.c +++ b/src/thread/pthread_cancel.c @@ -92,5 +92,6 @@ int pthread_cancel(pthread_t t) init = 1; } a_store(&t->cancel, 1); + if (t == pthread_self() && !t->cancelasync) return 0; return pthread_kill(t, SIGCANCEL); } |