blob: f0e8dade947d81355ffa9d422ed19554ea1123d4 [file] [log] [blame]
#include <zircon/process.h>
#include "threads_impl.h"
int __pthread_join(pthread_t t, void** res) {
switch (zxr_thread_join(&t->zxr_thread)) {
case ZX_OK:
__thread_list_erase(t);
if (res)
*res = t->result;
_zx_vmar_unmap(_zx_vmar_root_self(), (uintptr_t)t->tcb_region.iov_base,
t->tcb_region.iov_len);
return 0;
default:
return EINVAL;
}
}
weak_alias(__pthread_join, pthread_join);