xref: /aosp_15_r20/external/musl/src/thread/thrd_join.c (revision c9945492fdd68bbe62686c5b452b4dc1be3f8453)
1*c9945492SAndroid Build Coastguard Worker #include <stdint.h>
2*c9945492SAndroid Build Coastguard Worker #include <threads.h>
3*c9945492SAndroid Build Coastguard Worker #include <pthread.h>
4*c9945492SAndroid Build Coastguard Worker 
thrd_join(thrd_t t,int * res)5*c9945492SAndroid Build Coastguard Worker int thrd_join(thrd_t t, int *res)
6*c9945492SAndroid Build Coastguard Worker {
7*c9945492SAndroid Build Coastguard Worker         void *pthread_res;
8*c9945492SAndroid Build Coastguard Worker         __pthread_join(t, &pthread_res);
9*c9945492SAndroid Build Coastguard Worker         if (res) *res = (int)(intptr_t)pthread_res;
10*c9945492SAndroid Build Coastguard Worker         return thrd_success;
11*c9945492SAndroid Build Coastguard Worker }
12