Merge pull request #984 from jpcima/fix-background-thread-sync

Fix the VST thread synchronization on activate/deactivate
This commit is contained in:
JP Cimalando 2021-09-20 03:07:08 +02:00 committed by GitHub
commit 3e6a551c66
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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;