X-Git-Url: http://nsz.repo.hu/git/?p=musl;a=blobdiff_plain;f=src%2Fthread%2Fpthread_join.c;h=719c91ca24f7b03f729657a27208e10e3bf1c020;hp=664abda94a2616f14a318ddffb9b0a4ffb4aa34b;hb=d432b2c057fc64256645422382c2f7e32c45b3cc;hpb=ec381af90208a5675183202cf05078eac208edfb diff --git a/src/thread/pthread_join.c b/src/thread/pthread_join.c index 664abda9..719c91ca 100644 --- a/src/thread/pthread_join.c +++ b/src/thread/pthread_join.c @@ -1,4 +1,5 @@ #include "pthread_impl.h" +#include static void dummy(void *p) { @@ -6,8 +7,8 @@ static void dummy(void *p) int pthread_join(pthread_t t, void **res) { - int tmp = t->tid; - if (tmp) __timedwait(&t->tid, tmp, 0, 0, dummy, 0, 1); + int tmp; + while ((tmp = t->tid)) __timedwait(&t->tid, tmp, 0, 0, dummy, 0, 0); if (res) *res = t->result; if (t->map_base) munmap(t->map_base, t->map_size); return 0;