eventloop and abstractui debugging, lots more commenting on abstractui/eventloop...
[ardour.git] / libs / pbd / base_ui.cc
index ea7e469c74964ce16ab3ea2ee71f252cdf1768db..6c21549e8beb64e85f47b0631f96c2b8ef6fe68c 100644 (file)
@@ -25,6 +25,8 @@
 #include <cstring>
 
 #include "pbd/base_ui.h"
+#include "pbd/debug.h"
+#include "pbd/pthread_utils.h"
 #include "pbd/error.h"
 #include "pbd/compose.h"
 #include "pbd/failed_constructor.h"
@@ -40,7 +42,8 @@ BaseUI::RequestType BaseUI::CallSlot = BaseUI::new_request_type();
 BaseUI::RequestType BaseUI::Quit = BaseUI::new_request_type();
 
 BaseUI::BaseUI (const string& str)
-       : run_loop_thread (0)
+       : request_channel (true)
+       , run_loop_thread (0)
        , _name (str)
 {
        base_ui_instance = this;
@@ -70,7 +73,8 @@ BaseUI::new_request_type ()
 void
 BaseUI::main_thread ()
 {
-       set_ui_for_thread (this);
+       DEBUG_TRACE (DEBUG::EventLoop, string_compose ("%1: event loop running in thread %2\n", name(), pthread_self()));
+       set_event_loop_for_thread (this);
        thread_init ();
        _main_loop->run ();
 }
@@ -102,7 +106,7 @@ BaseUI::quit ()
 bool
 BaseUI::request_handler (Glib::IOCondition ioc)
 {
-       /* check the transport request pipe */
+       /* check the request pipe */
 
        if (ioc & ~IO_IN) {
                _main_loop->quit ();