[PATCH] Fix thd_join on win64

Mike Hommey mh+jemalloc at glandium.org
Wed May 28 17:03:00 PDT 2014


From: Mike Hommey <mh at glandium.org>

---
 test/src/thd.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

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



More information about the jemalloc-discuss mailing list