From bc80e97278905dce04848954d36883e447560843 Mon Sep 17 00:00:00 2001 From: Michael Dickens Date: Wed, 16 Sep 2015 14:38:36 -0400 Subject: utils: make UHD_MSG thread-safe, Now, only 1 thread can print at a time. --- host/lib/utils/msg.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'host/lib/utils/msg.cpp') diff --git a/host/lib/utils/msg.cpp b/host/lib/utils/msg.cpp index de98ada64..95879a116 100644 --- a/host/lib/utils/msg.cpp +++ b/host/lib/utils/msg.cpp @@ -79,6 +79,8 @@ void uhd::msg::register_handler(const handler_t &handler){ } static void 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){ case uhd::msg::fastpath: std::cerr << msg << std::flush; -- cgit v1.2.3