summaryrefslogtreecommitdiff
path: root/mysys/my_winthread.c
diff options
context:
space:
mode:
Diffstat (limited to 'mysys/my_winthread.c')
-rw-r--r--mysys/my_winthread.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/mysys/my_winthread.c b/mysys/my_winthread.c
index 31385fad360..f3335621c38 100644
--- a/mysys/my_winthread.c
+++ b/mysys/my_winthread.c
@@ -121,6 +121,15 @@ int pthread_join(pthread_t thread, void **value_ptr)
goto error_return;
}
+ if (!GetExitCodeThread(handle, &ret))
+ {
+ errno= EINVAL;
+ goto error_return;
+ }
+
+ if (value_ptr)
+ *value_ptr= (void *)(size_t)ret;
+
CloseHandle(handle);
return 0;