Rémi Bernon (@rbernon) commented about dlls/windows.media.speech/tests/speech.c:
ok(hr == S_OK, "ISpeechRecognizer_CompileConstraintsAsync failed, hr %#lx.\n", hr);
block_param.handler = &compilation_handler.IAsyncHandler_Compilation_iface;
block_param.operation = operation;
blocked_thread = CreateThread(NULL, 0, async_operation_block_thread, &block_param, 0, NULL);
put_completed_param.handler = &compilation_handler.IAsyncHandler_Compilation_iface;
put_completed_param.operation = operation;
put_thread = CreateThread(NULL, 0, put_completed_thread, &put_completed_param, 0, NULL); ok(!WaitForSingleObject(compilation_handler.event_finished, 5000), "Wait for event_finished failed.\n");
ok(WaitForSingleObject(blocked_thread, 100) == WAIT_TIMEOUT, "Wait for block_thread didn't time out.\n");
todo_wine ok(compilation_handler.ref == 3, "Got unexpected ref %lu.\n", compilation_handler.ref);
todo_wine check_refcount(operation, 3);
ok(WaitForSingleObject(compilation_handler.event_unblock, 100) == WAIT_TIMEOUT, "Wait for event_unblock didn't time out.\n");
I don't think it matters so much, but I also don't think this additional event is really useful. If wait succeeds here, it means that `event_block` wasn't waited on in the handler, which would mean something really bad is happening with events.
You could simply keep the thread wait and ref count tests removal here, as they are not reliable, and not add any additional event.