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); + + EnterCriticalSection(&impl->cs); + while (impl->worker_running) + { + /* TODO: Send mic data to recognizer and handle results. */ + + SleepConditionVariableCS(&impl->cv, &impl->cs, 500); /* Wait 500ms to slow down spinning for now. */
I think there's an even better way to write this, with a single SleepCV and infinite timeout. And later when the thread will have something to do, you would simply skip it unless it's also paused. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/729#note_20416