R��mi Bernon (@rbernon) commented about dlls/windows.media.speech/recognizer.c:
if (!ref) {
BOOLEAN running = FALSE;
EnterCriticalSection(&impl->cs);
running = impl->session_running;
LeaveCriticalSection(&impl->cs);
if (running) shutdown_session_thread(iface);
You'd need to set `impl->session_running` to `FALSE` and `WakeConditionVariable` too before joining the thread.