[PATCH] Correctly return exit code from thd_join on Windows

Mike Hommey mh+jemalloc at glandium.org
Tue May 27 22:06:30 PDT 2014


From: Mike Hommey <mh at glandium.org>

---
 test/src/thd.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/test/src/thd.c b/test/src/thd.c
index 233242a..7e53625 100644
--- a/test/src/thd.c
+++ b/test/src/thd.c
@@ -14,7 +14,8 @@ void
 thd_join(thd_t thd, void **ret)
 {
 
-	WaitForSingleObject(thd, INFINITE);
+	if (WaitForSingleObject(thd, INFINITE) == WAIT_OBJECT_0 && ret)
+		GetExitCodeThread(thd, (LPDWORD) ret);
 }
 
 #else
-- 
2.0.0.rc2



More information about the jemalloc-discuss mailing list