tests,w32: Fix thread creation in run-threaded
* tests/run-threaded.c (create_thread): Check proper return value and not return value of CloseHandle.
This commit is contained in:
parent
8f9f3224aa
commit
9bbe15ebbc
@ -56,12 +56,14 @@ static int mem_only;
|
|||||||
static void
|
static void
|
||||||
create_thread (THREAD_RET (*func) (void *), void *arg)
|
create_thread (THREAD_RET (*func) (void *), void *arg)
|
||||||
{
|
{
|
||||||
running_threads++;
|
HANDLE hd = CreateThread (NULL, 0, func, arg, 0, NULL);
|
||||||
if (CloseHandle (CreateThread (NULL, 0, func, arg, 0, NULL)))
|
if (hd == INVALID_HANDLE_VALUE)
|
||||||
{
|
{
|
||||||
fprintf (stderr, "Failed to create thread!\n");
|
fprintf (stderr, "Failed to create thread!\n");
|
||||||
exit (1);
|
exit (1);
|
||||||
}
|
}
|
||||||
|
running_threads++;
|
||||||
|
CloseHandle (hd);
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
Loading…
Reference in New Issue
Block a user