X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fthread%2Fpthread_create.c;h=d60c2a4d3b8442f2a2bba1ee3855096b84261e6c;hb=94a0171d807dc94302d6505041fc58879c27f3bd;hp=a645f9fe3d3b1ab007210d971beb9cb487728e1c;hpb=11e4b92556a02f43b500e6815690354b0f710843;p=musl diff --git a/src/thread/pthread_create.c b/src/thread/pthread_create.c index a645f9fe..d60c2a4d 100644 --- 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); } - LOCK(&self->exitlock); - __pthread_tsd_run_dtors(); + __lock(&self->exitlock); + /* Mark this thread dead before decrementing count */ + __lock(&self->killlock); 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);