diff --git a/dlls/ucrtbase/tests/thread.c b/dlls/ucrtbase/tests/thread.c index 8fffbffb38e..7693304e612 100644 --- a/dlls/ucrtbase/tests/thread.c +++ b/dlls/ucrtbase/tests/thread.c @@ -105,11 +105,11 @@ static void test_thread_library_reference(char *thread_dll, ok(thread_handle != -1 && thread_handle != 0, "Failed to begin thread: %u\n", errno); + ok(FreeLibrary(dll), "Failed to free the library: %u\n", GetLastError()); + ret = WaitForSingleObject(args.confirm_running, 200); ok(ret == WAIT_OBJECT_0, "Event was not signaled, ret: %u, err: %u\n", ret, GetLastError()); - ok(FreeLibrary(dll), "Failed to free the library: %u\n", GetLastError()); - ret = WaitForSingleObject(detach_event, 0); ok(ret == WAIT_TIMEOUT, "Thread detach happened unexpectedly signaling an event, ret: %d, err: %u\n", ret, GetLastError());