amend 67f9f6fd: no recursive ReaderLock
authorRobin Gareus <robin@gareus.org>
Sat, 3 Jun 2017 10:31:59 +0000 (12:31 +0200)
committerRobin Gareus <robin@gareus.org>
Sat, 3 Jun 2017 11:55:08 +0000 (13:55 +0200)
libs/ardour/ardour/slavable_automation_control.h
libs/ardour/slavable_automation_control.cc

index 8827b29f6b0f89f5e67fb1f403c7353281ccc950..6467dcd6decf0ed5575dd5d36c81169109413e79 100644 (file)
@@ -64,7 +64,13 @@ class LIBARDOUR_API SlavableAutomationControl : public AutomationControl
        int set_state (XMLNode const&, int);
        XMLNode& get_state();
 
-       bool find_next_event (double now, double end, Evoral::ControlEvent& next_event) const;
+       bool find_next_event (double n, double e, Evoral::ControlEvent& ev) const
+       {
+               Glib::Threads::RWLock::ReaderLock lm (master_lock);
+               return find_next_event_locked (n, e, ev);
+       }
+
+       bool find_next_event_locked (double now, double end, Evoral::ControlEvent& next_event) const;
 
     protected:
 
index 51b2d30004eb8a9d3d58a8291f32c502f1f61625..6df2dd2720adb5a29716cef1438343bd31584783 100644 (file)
@@ -345,9 +345,8 @@ SlavableAutomationControl::clear_masters ()
 }
 
 bool
-SlavableAutomationControl::find_next_event (double now, double end, Evoral::ControlEvent& next_event) const
+SlavableAutomationControl::find_next_event_locked (double now, double end, Evoral::ControlEvent& next_event) const
 {
-       Glib::Threads::RWLock::ReaderLock lm (master_lock);
        if (_masters.empty()) {
                return false;
        }
@@ -363,7 +362,7 @@ SlavableAutomationControl::find_next_event (double now, double end, Evoral::Cont
                boost::shared_ptr<SlavableAutomationControl> sc
                        = boost::dynamic_pointer_cast<SlavableAutomationControl>(ac);
 
-               if (sc && sc->find_next_event (now, end, next_event)) {
+               if (sc && sc->find_next_event_locked (now, end, next_event)) {
                        rv = true;
                }