Parallel restore checks wrong thread return value?

Started by Magnus Haganderalmost 15 years ago2 messages
#1Magnus Hagander
magnus@hagander.net

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?

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

#2Magnus Hagander
magnus@hagander.net
In reply to: Magnus Hagander (#1)
Re: Parallel restore checks wrong thread return value?

On Sat, Feb 26, 2011 at 16:51, Magnus Hagander <magnus@hagander.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/