Re: Parallel restore checks wrong thread return value?

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Parallel restore checks wrong thread return value?
Date: 2011-02-26 16:47:45
Message-ID: AANLkTi=x4sq5Q5M1UnnazDw8AdeTk_vpNkbCREC=aF4T@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Feb 26, 2011 at 16:51, Magnus Hagander <magnus(at)hagander(dot)net> wrote:
> in spawn_restore:
>
>
>        child = (HANDLE) _beginthreadex(NULL, 0, (void *) parallel_restore,
>                                                                        args, 0, NULL);
>        if (child == 0)
>
>
> But from my reading of the docs, _beginthreadex() returns -1 on error, not 0.
>
> Bug, or am I reading it wrong?

I was.

_beginthread() returns -1 on error, and _beginthreadex() returns 0.

That's just brilliant.

Sorry about the noise.

--
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2011-02-26 17:18:46 Re: wCTE: why not finish sub-updates at the end, not the beginning?
Previous Message Greg Stark 2011-02-26 16:20:31 Re: wCTE: why not finish sub-updates at the end, not the beginning?