Fix the VST thread synchronization on activate/deactivate

This commit is contained in:
Jean Pierre Cimalando 2021-09-20 03:03:36 +02:00
parent fbac436cc0
commit 174d58fd87

View file

@ -740,8 +740,13 @@ void SfizzVstProcessor::doBackgroundWork()
for (;;) { for (;;) {
bool isNotified = _semaToWorker.timed_wait(kBackgroundIdleInterval.count()); bool isNotified = _semaToWorker.timed_wait(kBackgroundIdleInterval.count());
if (!_workRunning) if (!_workRunning) {
// if the quit signal is sent, the semaphore is also signaled
// make sure the count is kept consistent
if (!isNotified)
_semaToWorker.wait();
break; break;
}
const char* id = nullptr; const char* id = nullptr;
RTMessagePtr msg; RTMessagePtr msg;