pthread_join.c 276 B

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