Browse Source

Fix a possible race condition

tags/v2.1-alpha1-winvst
falkTX 6 years ago
parent
commit
2b983e8375
1 changed files with 4 additions and 3 deletions
  1. +4
    -3
      source/backend/plugin/CarlaPluginInternal.cpp

+ 4
- 3
source/backend/plugin/CarlaPluginInternal.cpp View File

@@ -528,10 +528,11 @@ void CarlaPlugin::ProtectedData::PostRtEvents::appendRT(const PluginPostRtEvent&

void CarlaPlugin::ProtectedData::PostRtEvents::trySplice() noexcept
{
if (dataMutex.tryLock())
const CarlaMutexTryLocker cmtl(dataPendingMutex);

if (cmtl.wasLocked() && dataPendingRT.count() > 0 && dataMutex.tryLock())
{
if (dataPendingRT.count() > 0)
dataPendingRT.moveTo(data, true);
dataPendingRT.moveTo(data, true);
dataMutex.unlock();
}
}


Loading…
Cancel
Save