initial check-in, version 0.5.0
[musl] / src / thread / pthread_join.c
1 #include "pthread_impl.h"
2
3 int pthread_join(pthread_t t, void **res)
4 {
5         int tmp = t->tid;
6         CANCELPT_BEGIN;
7         if (tmp) __wait(&t->tid, 0, tmp, 1);
8         CANCELPT_END;
9         if (res) *res = t->result;
10         if (t->map_base) munmap(t->map_base, t->map_size);
11         return 0;
12 }