summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2012-06-28 15:37:54 +0000
committerCarl Hetherington <carl@carlh.net>2012-06-28 15:37:54 +0000
commite09e185e3e08665db9299188d8f15fd3de733262 (patch)
treee2941861a4bdded2bb3ffccbcb5e1fdb960fae5e /libs
parent1708ab55b93fd81422c38bd199483788ad928d56 (diff)
Add what I think is a missing lock when reading controllables.
git-svn-id: svn://localhost/ardour2/branches/3.0@12958 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r--libs/surfaces/generic_midi/generic_midi_control_protocol.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/libs/surfaces/generic_midi/generic_midi_control_protocol.cc b/libs/surfaces/generic_midi/generic_midi_control_protocol.cc
index 25b8d5db85..d6a75f66f9 100644
--- a/libs/surfaces/generic_midi/generic_midi_control_protocol.cc
+++ b/libs/surfaces/generic_midi/generic_midi_control_protocol.cc
@@ -24,6 +24,7 @@
#include <glibmm/fileutils.h>
#include <glibmm/miscutils.h>
+#include <glibmm/thread.h>
#include "pbd/controllable_descriptor.h"
#include "pbd/error.h"
@@ -284,6 +285,12 @@ GenericMidiControlProtocol::_send_feedback ()
in a single jack_midi_event_write then some bridges will only pass the
first on to ALSA.
*/
+
+ Glib::Mutex::Lock lm (controllables_lock, Glib::TRY_LOCK);
+ if (!lm.locked ()) {
+ return;
+ }
+
for (MIDIControllables::iterator r = controllables.begin(); r != controllables.end(); ++r) {
MIDI::byte* end = (*r)->write_feedback (buf, bsize);
if (end != buf) {