Files
musl/src/thread/pthread_join.c

17 lines
360 B
C
Raw Normal View History

2011-02-12 00:22:29 -05:00
#include "pthread_impl.h"
#include <sys/mman.h>
2011-02-12 00:22:29 -05:00
int __munmap(void *, size_t);
int __pthread_join(pthread_t t, void **res)
2011-02-12 00:22:29 -05:00
{
int tmp;
pthread_testcancel();
while ((tmp = t->tid)) __timedwait_cp(&t->tid, tmp, 0, 0, 0);
2011-02-12 00:22:29 -05:00
if (res) *res = t->result;
if (t->map_base) __munmap(t->map_base, t->map_size);
2011-02-12 00:22:29 -05:00
return 0;
}
weak_alias(__pthread_join, pthread_join);