projects
/
oweals
/
musl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
47314f1
)
avoid using signals when a thread attempts to cancel itself
author
Rich Felker
<dalias@aerifal.cx>
Thu, 4 Feb 2016 22:59:13 +0000
(22:59 +0000)
committer
Rich Felker
<dalias@aerifal.cx>
Thu, 4 Feb 2016 22:59:13 +0000
(22:59 +0000)
not only is pthread_kill expensive in this case; it also breaks
testing under qemu app-level emulation.
src/thread/pthread_cancel.c
patch
|
blob
|
history
diff --git
a/src/thread/pthread_cancel.c
b/src/thread/pthread_cancel.c
index a21c386697c3e399c6c86e18d6be56c77a05d284..3d229223ed1b00f622c3319b7cfa327086f530d7 100644
(file)
--- 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);
}