diff options
author | Robin Gareus <robin@gareus.org> | 2017-07-04 20:44:33 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2017-07-04 20:44:33 +0200 |
commit | cd30a296917b8cf5cad56baf7a5862ed9dafb871 (patch) | |
tree | d3690b90eb3be6d5d183d16aeb634a261f98232a /libs/ardour | |
parent | c4578db595771b5db9572b23cfe3f9a7ebef66c3 (diff) |
Fix session-event queue (multiple writer, single reader)
The reading is done in rt-process thread, but multiple UIs (surfaces,
GUI) can produce events to be queued.
Diffstat (limited to 'libs/ardour')
-rw-r--r-- | libs/ardour/ardour/session_event.h | 2 | ||||
-rw-r--r-- | libs/ardour/session_process.cc | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/libs/ardour/ardour/session_event.h b/libs/ardour/ardour/session_event.h index fe109a21f8..643b863537 100644 --- a/libs/ardour/ardour/session_event.h +++ b/libs/ardour/ardour/session_event.h @@ -167,6 +167,8 @@ protected: Events immediate_events; Events::iterator next_event; + Glib::Threads::Mutex rb_write_lock; + /* there can only ever be one of each of these */ SessionEvent *auto_loop_event; diff --git a/libs/ardour/session_process.cc b/libs/ardour/session_process.cc index 7788eb2b97..fabf4d7d01 100644 --- a/libs/ardour/session_process.cc +++ b/libs/ardour/session_process.cc @@ -1033,6 +1033,7 @@ Session::queue_event (SessionEvent* ev) } else if (_state_of_the_state & Loading) { merge_event (ev); } else { + Glib::Threads::Mutex::Lock lm (rb_write_lock); pending_events.write (&ev, 1); } } |