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 (;;) {
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;
}
const char* id = nullptr;
RTMessagePtr msg;