Skip to content

Commit

Permalink
Merge pull request #984 from jpcima/fix-background-thread-sync
Browse files Browse the repository at this point in the history
Fix the VST thread synchronization on activate/deactivate
  • Loading branch information
jpcima authored Sep 20, 2021
2 parents fbac436 + 174d58f commit 3e6a551
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion plugins/vst/SfizzVstProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 3e6a551

Please sign in to comment.