summaryrefslogtreecommitdiffstats
path: root/host/include
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-06-01 13:57:25 -0700
committerJosh Blum <josh@joshknows.com>2011-06-01 13:57:25 -0700
commit19ecd43340ce16ced6be530c9dff5cf724a6e160 (patch)
tree38b761e1f02ece14dcbcc0e8d9184087c638f291 /host/include
parentdb6fa3812a673481df25f49c0081d4ca63200c66 (diff)
downloaduhd-19ecd43340ce16ced6be530c9dff5cf724a6e160.tar.gz
uhd-19ecd43340ce16ced6be530c9dff5cf724a6e160.tar.bz2
uhd-19ecd43340ce16ced6be530c9dff5cf724a6e160.zip
uhd: tweaks to log and msg implementation
The implementations now contain the string stream in each instance. This way there is not a global stringstream to lock access to. This resolves the issue of nested log calls locking condition.
Diffstat (limited to 'host/include')
-rw-r--r--host/include/uhd/utils/log.hpp6
-rw-r--r--host/include/uhd/utils/msg.hpp6
2 files changed, 10 insertions, 2 deletions
diff --git a/host/include/uhd/utils/log.hpp b/host/include/uhd/utils/log.hpp
index bc8f41fb4..1f515c15e 100644
--- a/host/include/uhd/utils/log.hpp
+++ b/host/include/uhd/utils/log.hpp
@@ -19,6 +19,7 @@
#define INCLUDED_UHD_UTILS_LOG_HPP
#include <uhd/config.hpp>
+#include <uhd/utils/pimpl.hpp>
#include <boost/current_function.hpp>
#include <ostream>
#include <string>
@@ -77,7 +78,8 @@ namespace uhd{ namespace _log{
};
//! Internal logging object (called by UHD_LOG macros)
- struct UHD_API log{
+ class UHD_API log{
+ public:
log(
const verbosity_t verbosity,
const std::string &file,
@@ -86,6 +88,8 @@ namespace uhd{ namespace _log{
);
~log(void);
std::ostream &operator()(void);
+ private:
+ UHD_PIMPL_DECL(impl) _impl;
};
}} //namespace uhd::_log
diff --git a/host/include/uhd/utils/msg.hpp b/host/include/uhd/utils/msg.hpp
index 050504e57..71d2cb35e 100644
--- a/host/include/uhd/utils/msg.hpp
+++ b/host/include/uhd/utils/msg.hpp
@@ -19,6 +19,7 @@
#define INCLUDED_UHD_UTILS_MSG_HPP
#include <uhd/config.hpp>
+#include <uhd/utils/pimpl.hpp>
#include <ostream>
#include <string>
@@ -52,10 +53,13 @@ namespace uhd{ namespace msg{
UHD_API void register_handler(const handler_t &handler);
//! Internal message object (called by UHD_MSG macro)
- struct UHD_API _msg{
+ class UHD_API _msg{
+ public:
_msg(const type_t type);
~_msg(void);
std::ostream &operator()(void);
+ private:
+ UHD_PIMPL_DECL(impl) _impl;
};
}} //namespace uhd::msg