Skip to content

Commit

Permalink
Fix the VST thread synchronization on activate/deactivate
Browse files Browse the repository at this point in the history
  • Loading branch information
jpcima committed Sep 20, 2021
1 parent fbac436 commit 174d58f
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 174d58f

Please sign in to comment.