From 19ecd43340ce16ced6be530c9dff5cf724a6e160 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Wed, 1 Jun 2011 13:57:25 -0700 Subject: 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. --- host/include/uhd/utils/log.hpp | 6 +++++- host/include/uhd/utils/msg.hpp | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'host/include') 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 +#include #include #include #include @@ -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 +#include #include #include @@ -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 -- cgit v1.2.3