summaryrefslogtreecommitdiff
path: root/libs/ardour/midi_ui.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2015-12-28 10:14:17 -0500
committerPaul Davis <paul@linuxaudiosystems.com>2015-12-28 10:14:17 -0500
commit0d9efc11484c901795ff4e9549a1a39715d0474d (patch)
tree956ab3cd570670bcb1ff68856553f5aec4a8e470 /libs/ardour/midi_ui.cc
parentdb4834027858b10f313c822c7fb3fad1617f11aa (diff)
redesign cross-thread registration/signalling system
This new design will work even when threads that need to receive messages from RT threads are created *after* the RT threads. The existing design would fail because the RT thread(s) would never be known the later created threads, and so signals emitted by the RT thread and causing call_slot() in the receiver would end up being enqueued using a lock-protected list. The new design ensures that communication always uses a lock-free FIFO instead
Diffstat (limited to 'libs/ardour/midi_ui.cc')
-rw-r--r--libs/ardour/midi_ui.cc13
1 files changed, 12 insertions, 1 deletions
diff --git a/libs/ardour/midi_ui.cc b/libs/ardour/midi_ui.cc
index 96304fa051..1d2fe7c7e1 100644
--- a/libs/ardour/midi_ui.cc
+++ b/libs/ardour/midi_ui.cc
@@ -60,6 +60,17 @@ MidiControlUI::~MidiControlUI ()
_instance = 0;
}
+void*
+MidiControlUI::request_factory (uint32_t num_requests)
+{
+ /* AbstractUI<T>::request_buffer_factory() is a template method only
+ instantiated in this source module. To provide something visible for
+ use when registering the factory, we have this static method that is
+ template-free.
+ */
+ return request_buffer_factory (num_requests);
+}
+
void
MidiControlUI::do_request (MidiUIRequest* req)
{
@@ -131,7 +142,7 @@ MidiControlUI::thread_init ()
pthread_set_name (X_("midiUI"));
- PBD::notify_gui_about_thread_creation (X_("gui"), pthread_self(), X_("midiUI"), 2048);
+ PBD::notify_event_loops_about_thread_creation (pthread_self(), X_("midiUI"), 2048);
SessionEvent::create_per_thread_pool (X_("midiUI"), 128);
memset (&rtparam, 0, sizeof (rtparam));