aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/utils/msg.cpp
diff options
context:
space:
mode:
authorMichael Dickens <michael.dickens@ettus.com>2015-09-16 14:38:36 -0400
committerMartin Braun <martin.braun@ettus.com>2015-09-18 10:44:39 -0700
commitbc80e97278905dce04848954d36883e447560843 (patch)
tree94c5a2f845ef4b4bd9d6ea136fd0ad0c98863553 /host/lib/utils/msg.cpp
parent0975f65da52af622dccbb133dbbf489973c70ce0 (diff)
downloaduhd-bc80e97278905dce04848954d36883e447560843.tar.gz
uhd-bc80e97278905dce04848954d36883e447560843.tar.bz2
uhd-bc80e97278905dce04848954d36883e447560843.zip
utils: make UHD_MSG thread-safe,
Now, only 1 thread can print at a time.
Diffstat (limited to 'host/lib/utils/msg.cpp')
-rw-r--r--host/lib/utils/msg.cpp2
1 files changed, 2 insertions, 0 deletions
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;