diff options
Diffstat (limited to 'gnuradio-runtime')
-rw-r--r-- | gnuradio-runtime/include/gnuradio/logger.h | 28 | ||||
-rw-r--r-- | gnuradio-runtime/include/gnuradio/tags.h | 18 | ||||
-rw-r--r-- | gnuradio-runtime/lib/pmt/pmt.cc | 13 | ||||
-rw-r--r-- | gnuradio-runtime/lib/pmt/pmt_int.h | 7 |
4 files changed, 34 insertions, 32 deletions
diff --git a/gnuradio-runtime/include/gnuradio/logger.h b/gnuradio-runtime/include/gnuradio/logger.h index 4299a11beb..74b9ee2ea5 100644 --- a/gnuradio-runtime/include/gnuradio/logger.h +++ b/gnuradio-runtime/include/gnuradio/logger.h @@ -30,7 +30,7 @@ */ #ifdef _MSC_VER -typedef unsigned short mode_t; +typedef int mode_t; #else #include <sys/types.h> #endif @@ -103,20 +103,6 @@ namespace gr { #define GR_LOG_GET_LEVEL(logger, level) \ gr::logger_get_level(logger,level); -#define GR_ADD_APPENDER(name, appender) { \ - gr::logger_ptr logger = gr::logger_get_logger(name); \ - gr::logger_add_appender(logger,appender);} - -#define GR_LOG_ADD_APPENDER(logger, appender) { \ - gr::logger_add_appender(logger, appender);} - -#define GR_SET_APPENDER(name, appender) { \ - gr::logger_ptr logger = gr::logger_get_logger(name); \ - gr::logger_set_appender(logger,appender);} - -#define GR_LOG_SET_APPENDER(logger, appender) { \ - gr::logger_set_appender(logger, appender);} - #define GR_ADD_CONSOLE_APPENDER(name, target, pattern) { \ gr::logger_ptr logger = gr::logger_get_logger(name); \ gr::logger_add_console_appender(logger,target,pattern);} @@ -630,18 +616,6 @@ namespace gr { /*! \brief inline function, wrapper for LOG4CPP_ASSERT for conditional ERROR message */ void log_assert(bool cond,std::string msg){GR_LOG_ASSERT(d_logger,cond,msg);} - /*! \brief inline function, Method to add appender to logger by - name (define appender in conf file) */ - void add_appender(std::string appender) { - GR_LOG_ADD_APPENDER(d_logger, appender); - } - - /*! \brief inline function, Method to set an appender to logger by - name (define appender in conf file) */ - void set_appender(std::string appender) { - GR_LOG_SET_APPENDER(d_logger, appender); - } - /*! \brief inline function, Method to add console appender to logger */ void add_console_appender(std::string target,std::string pattern) { GR_LOG_ADD_CONSOLE_APPENDER(d_logger, target, pattern); diff --git a/gnuradio-runtime/include/gnuradio/tags.h b/gnuradio-runtime/include/gnuradio/tags.h index 0551e468d1..df65e50698 100644 --- a/gnuradio-runtime/include/gnuradio/tags.h +++ b/gnuradio-runtime/include/gnuradio/tags.h @@ -69,6 +69,24 @@ namespace gr { { } + tag_t(const tag_t &rhs) + : offset(rhs.offset), + key(rhs.key), + value(rhs.value), + srcid(rhs.srcid) + { + } + tag_t& operator=(const tag_t &rhs) + { + if (this != &rhs) { + offset = rhs.offset; + key = rhs.key; + value = rhs.value; + srcid = rhs.srcid; + } + return (*this); + } + ~tag_t() { } diff --git a/gnuradio-runtime/lib/pmt/pmt.cc b/gnuradio-runtime/lib/pmt/pmt.cc index e09452e60e..da2a7e5cc2 100644 --- a/gnuradio-runtime/lib/pmt/pmt.cc +++ b/gnuradio-runtime/lib/pmt/pmt.cc @@ -63,9 +63,18 @@ pmt_base::operator delete(void *p, size_t size) #endif -void intrusive_ptr_add_ref(pmt_base* p) { ++(p->count_); } -void intrusive_ptr_release(pmt_base* p) { if (--(p->count_) == 0 ) delete p; } +void intrusive_ptr_add_ref(pmt_base* p) +{ + p->refcount_.fetch_add(1, boost::memory_order_relaxed); +} +void intrusive_ptr_release(pmt_base* p) { + if (p->refcount_.fetch_sub(1, boost::memory_order_release) == 1) { + boost::atomic_thread_fence(boost::memory_order_acquire); + delete p; + } +} + pmt_base::~pmt_base() { // nop -- out of line virtual destructor diff --git a/gnuradio-runtime/lib/pmt/pmt_int.h b/gnuradio-runtime/lib/pmt/pmt_int.h index 49bde52063..f06f507944 100644 --- a/gnuradio-runtime/lib/pmt/pmt_int.h +++ b/gnuradio-runtime/lib/pmt/pmt_int.h @@ -24,7 +24,8 @@ #include <pmt/pmt.h> #include <boost/utility.hpp> -#include <boost/detail/atomic_count.hpp> +#include <boost/version.hpp> +#include <boost/atomic.hpp> /* * EVERYTHING IN THIS FILE IS PRIVATE TO THE IMPLEMENTATION! @@ -36,10 +37,10 @@ namespace pmt { class PMT_API pmt_base : boost::noncopyable { - mutable boost::detail::atomic_count count_; + mutable boost::atomic<int> refcount_; protected: - pmt_base() : count_(0) {}; + pmt_base() : refcount_(0) {}; virtual ~pmt_base(); public: |