summaryrefslogtreecommitdiff
path: root/src/thread/thrd_join.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/thread/thrd_join.c')
-rw-r--r--src/thread/thrd_join.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/thread/thrd_join.c b/src/thread/thrd_join.c
new file mode 100644
index 00000000..ac667893
--- /dev/null
+++ b/src/thread/thrd_join.c
@@ -0,0 +1,12 @@
+#include <stdint.h>
+#include <threads.h>
+
+int __pthread_join(thrd_t, void**);
+
+int thrd_join(thrd_t t, int *res)
+{
+ void *pthread_res;
+ __pthread_join(t, &pthread_res);
+ if (res) *res = (int)(intptr_t)pthread_res;
+ return thrd_success;
+}