Rémi Bernon (@rbernon) commented about dlls/windows.media.speech/recognizer.c:
static HRESULT session_pause_async( IInspectable *invoker ) {
- struct session *impl = impl_from_ISpeechContinuousRecognitionSession((ISpeechContinuousRecognitionSession *)invoker);
- EnterCriticalSection(&impl->cs);
- if (impl->worker_running) impl->worker_paused = TRUE;
- LeaveCriticalSection(&impl->cs);
You don't *have* to, here, because the thread will eventually check it, but I think it's maybe better to notify the condition variable every time a flag that can be waited on is modified.