On Tue Sep 6 05:38:41 2022 +0000, Rémi Bernon wrote:
I believe a more canonical way to write this thread would be something like:
EnterCriticalSection(&impl->cs); while (impl->session_running) { if (impl->session_paused) { SleepConditionVariableCS(&impl->cv, &impl->cs, INFINITE); continue; } /* TODO: Send mic data to recognizer. */ Sleep(500); /* Sleep to slow down spinning for now. */ } LeaveCriticalSection(&impl->cs);
I think this would block making changes to the session_running variable as long as the session is running, which isn't wanted.