[PATCH] Correctly return exit code from thd_join on Windows

Paul Pedriana paul at pedriana.com
Wed May 28 12:10:15 PDT 2014


I'm not sure that Windows GetExitCodeThread usage is right. DWORD is 32
bits even on 64 bit Windows, so on Win64 when you cast void** ret to DWORD*
you have a size mismatch.
On May 27, 2014 10:06 PM, "Mike Hommey" <mh+jemalloc at glandium.org> wrote:

> 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
>
> _______________________________________________
> jemalloc-discuss mailing list
> jemalloc-discuss at canonware.com
> http://www.canonware.com/mailman/listinfo/jemalloc-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jemalloc.net/mailman/jemalloc-discuss/attachments/20140528/ff03117b/attachment.html>


More information about the jemalloc-discuss mailing list