Обсуждение: Parallel restore checks wrong thread return value?

Поиск
Список
Период
Сортировка

Parallel restore checks wrong thread return value?

От
Magnus Hagander
Дата:
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/


Re: Parallel restore checks wrong thread return value?

От
Magnus Hagander
Дата:
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/