diff options
author | Paul David <paul.david@ettus.com> | 2017-01-17 18:23:56 -0500 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2017-01-19 18:26:35 -0800 |
commit | b95eccb40d4d603131f77f609f596c3032847cb0 (patch) | |
tree | 5623c50eafc7c62c98b2a0f8644ca10ea9b3e489 /host/lib/utils/msg.cpp | |
parent | 157b17049f2ffe407183900954f56b103eb710fb (diff) | |
download | uhd-b95eccb40d4d603131f77f609f596c3032847cb0.tar.gz uhd-b95eccb40d4d603131f77f609f596c3032847cb0.tar.bz2 uhd-b95eccb40d4d603131f77f609f596c3032847cb0.zip |
x300: Output system messages in order for multi-threaded initialization
Diffstat (limited to 'host/lib/utils/msg.cpp')
-rw-r--r-- | host/lib/utils/msg.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/host/lib/utils/msg.cpp b/host/lib/utils/msg.cpp index 95879a116..d9d2fb66a 100644 --- a/host/lib/utils/msg.cpp +++ b/host/lib/utils/msg.cpp @@ -78,7 +78,12 @@ void uhd::msg::register_handler(const handler_t &handler){ msg_rs().handler = handler; } -static void default_msg_handler(uhd::msg::type_t type, const std::string &msg){ +const uhd::msg::handler_t& uhd::msg::get_handler(){ + boost::mutex::scoped_lock lock(msg_rs().mutex); + return msg_rs().handler; +} + +void uhd::msg::default_msg_handler(uhd::msg::type_t type, const std::string &msg){ static boost::mutex msg_mutex; boost::mutex::scoped_lock lock(msg_mutex); switch(type){ @@ -104,7 +109,7 @@ static void default_msg_handler(uhd::msg::type_t type, const std::string &msg){ } UHD_STATIC_BLOCK(msg_register_default_handler){ - uhd::msg::register_handler(&default_msg_handler); + uhd::msg::register_handler(&uhd::msg::default_msg_handler); } /*********************************************************************** |