pthread_join.c 298 B

123456789101112131415
  1. #include "pthread_impl.h"
  2. #include <sys/mman.h>
  3. static void dummy(void *p)
  4. {
  5. }
  6. int pthread_join(pthread_t t, void **res)
  7. {
  8. int tmp;
  9. while ((tmp = t->tid)) __timedwait(&t->tid, tmp, 0, 0, dummy, 0, 0);
  10. if (res) *res = t->result;
  11. if (t->map_base) munmap(t->map_base, t->map_size);
  12. return 0;
  13. }