projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix logic error in fread
[musl]
/
src
/
thread
/
pthread_create.c
diff --git
a/src/thread/pthread_create.c
b/src/thread/pthread_create.c
index
a645f9f
..
d60c2a4
100644
(file)
--- a/
src/thread/pthread_create.c
+++ b/
src/thread/pthread_create.c
@@
-22,12
+22,14
@@
void __pthread_unwind_next(struct __ptcb *cb)
longjmp((void *)cb->__next->__jb, 1);
}
longjmp((void *)cb->__next->__jb, 1);
}
- LOCK(&self->exitlock);
-
__pthread_tsd_run_dtors();
__pthread_tsd_run_dtors();
+ __lock(&self->exitlock);
+
/* Mark this thread dead before decrementing count */
/* Mark this thread dead before decrementing count */
+ __lock(&self->killlock);
self->dead = 1;
self->dead = 1;
+ a_store(&self->killlock, 0);
do n = libc.threads_minus_1;
while (n && a_cas(&libc.threads_minus_1, n, n-1)!=n);
do n = libc.threads_minus_1;
while (n && a_cas(&libc.threads_minus_1, n, n-1)!=n);