Add missing error check for thread creation for WIN32

_beginthread() call in empth_create() has two error
return values 0L and 1L.  Add the missing check for 0L.
This commit is contained in:
Ron Koenderink 2008-09-11 19:14:35 -06:00
parent af2a87e490
commit 4d7d7bb77e

View file

@ -458,7 +458,7 @@ empth_create(void (*entry)(void *), int size, int flags,
size = loc_MIN_THREAD_STACK;
pThread->ulThreadID = _beginthread(empth_threadMain, size, pThread);
if (pThread->ulThreadID == 1L) {
if (pThread->ulThreadID == 1L || pThread->ulThreadID == 0L) {
logerror("can not create thread: %s: %s", name, strerror(errno));
goto bad;
}