X-Git-Url: http://nsz.repo.hu/git/?p=musl;a=blobdiff_plain;f=src%2Fthread%2Fpthread_join.c;h=719c91ca24f7b03f729657a27208e10e3bf1c020;hp=1b0c4f35de683bac3d15a5c4b6e0c87a61b49501;hb=96fbcf7d80f469e39d1dd12533f8bb8d13b64fe5;hpb=eb351a9e633e5893f0c3bb48808c3ed0280585b5 diff --git a/src/thread/pthread_join.c b/src/thread/pthread_join.c index 1b0c4f35..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, 0); + 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;