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:
e746640
)
don't use pthread_once when there is no danger in race
author
Rich Felker
<dalias@aerifal.cx>
Sun, 17 Apr 2011 16:15:55 +0000
(12:15 -0400)
committer
Rich Felker
<dalias@aerifal.cx>
Sun, 17 Apr 2011 16:15:55 +0000
(12:15 -0400)
src/thread/cancel_impl.c
patch
|
blob
|
history
diff --git
a/src/thread/cancel_impl.c
b/src/thread/cancel_impl.c
index 28dc84dc497fd6176481d32178be63b49de8c8ea..7bcfaef5dbd82bafa744646bbd2768e15783684b 100644
(file)
--- a/
src/thread/cancel_impl.c
+++ b/
src/thread/cancel_impl.c
@@
-71,8
+71,11
@@
static void init_cancellation()
int pthread_cancel(pthread_t t)
{
- static pthread_once_t once;
- pthread_once(&once, init_cancellation);
+ static int init;
+ if (!init) {
+ init_cancellation();
+ init = 1;
+ }
a_store(&t->cancel, 1);
return pthread_kill(t, SIGCANCEL);
}