Rémi Bernon (@rbernon) commented about dlls/windows.media.speech/recognizer.c:
return CONTAINING_RECORD(iface, struct session, ISpeechContinuousRecognitionSession_iface); }
+static DWORD CALLBACK session_worker_thread_cb( void *args ) +{ + ISpeechContinuousRecognitionSession *iface = args; + struct session *impl = impl_from_ISpeechContinuousRecognitionSession(iface); + BOOLEAN running; + DWORD status; + + EnterCriticalSection(&impl->cs); + running = impl->worker_running; + LeaveCriticalSection(&impl->cs); + + while (running)
I think you can assume running is true on first iteration, then you should get an event notification if it's been stopped already, and read it from within the CS in a single place. You can also maybe change this to a `do {} while(running)` loop too. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/729#note_20702