Browse Source

Use RecursiveMutex for CLAP UI events

Signed-off-by: falkTX <falktx@falktx.com>
pull/409/head
falkTX 2 years ago
parent
commit
ca571e3fdc
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
1 changed files with 4 additions and 4 deletions
  1. +4
    -4
      distrho/src/DistrhoPluginCLAP.cpp

+ 4
- 4
distrho/src/DistrhoPluginCLAP.cpp View File

@@ -89,7 +89,7 @@ struct ClapEventQueue
}; };


struct Queue { struct Queue {
Mutex lock;
RecursiveMutex lock;
uint allocated; uint allocated;
uint used; uint used;
Event* events; Event* events;
@@ -106,7 +106,7 @@ struct ClapEventQueue


void addEventFromUI(const Event& event) void addEventFromUI(const Event& event)
{ {
const MutexLocker cml(lock);
const RecursiveMutexLocker crml(lock);


if (events == nullptr) if (events == nullptr)
{ {
@@ -827,9 +827,9 @@ public:
#if DISTRHO_PLUGIN_HAS_UI #if DISTRHO_PLUGIN_HAS_UI
if (const clap_output_events_t* const outputEvents = process->out_events) if (const clap_output_events_t* const outputEvents = process->out_events)
{ {
const MutexTryLocker cmtl(fEventQueue.lock);
const RecursiveMutexTryLocker crmtl(fEventQueue.lock);


if (cmtl.wasLocked())
if (crmtl.wasLocked())
{ {
// reuse the same struct for gesture and parameters, they are compatible up to where it matters // reuse the same struct for gesture and parameters, they are compatible up to where it matters
clap_event_param_value_t clapEvent = { clap_event_param_value_t clapEvent = {


Loading…
Cancel
Save