diff options
author | Andre Heinecke <[email protected]> | 2019-06-05 14:07:43 +0000 |
---|---|---|
committer | Andre Heinecke <[email protected]> | 2019-06-05 14:20:31 +0000 |
commit | 9bbe15ebbc41533fa219d5b3017a26a75bc72731 (patch) | |
tree | ba616cf81ea546a4dfa364dba84b80b974fe4c57 /tests/run-threaded.c | |
parent | core: Improve the debug messages even more. (diff) | |
download | gpgme-9bbe15ebbc41533fa219d5b3017a26a75bc72731.tar.gz gpgme-9bbe15ebbc41533fa219d5b3017a26a75bc72731.zip |
tests,w32: Fix thread creation in run-threaded
* tests/run-threaded.c (create_thread): Check proper return
value and not return value of CloseHandle.
Diffstat (limited to 'tests/run-threaded.c')
-rw-r--r-- | tests/run-threaded.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/run-threaded.c b/tests/run-threaded.c index 02524b22..7041da8d 100644 --- a/tests/run-threaded.c +++ b/tests/run-threaded.c @@ -56,12 +56,14 @@ static int mem_only; static void create_thread (THREAD_RET (*func) (void *), void *arg) { - running_threads++; - if (CloseHandle (CreateThread (NULL, 0, func, arg, 0, NULL))) + HANDLE hd = CreateThread (NULL, 0, func, arg, 0, NULL); + if (hd == INVALID_HANDLE_VALUE) { fprintf (stderr, "Failed to create thread!\n"); exit (1); } + running_threads++; + CloseHandle (hd); } #else |