From e3379b56d48f149df81760b897bbf0d562cef848 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Sun, 17 Mar 2013 23:46:55 -0700 Subject: gras: more changes to get compiling w/ maint --- gnuradio-core/src/lib/runtime/gr_block.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'gnuradio-core/src/lib/runtime/gr_block.h') diff --git a/gnuradio-core/src/lib/runtime/gr_block.h b/gnuradio-core/src/lib/runtime/gr_block.h index 9c8485663..6919b204e 100644 --- a/gnuradio-core/src/lib/runtime/gr_block.h +++ b/gnuradio-core/src/lib/runtime/gr_block.h @@ -26,6 +26,7 @@ #include #include #include +#include namespace gnuradio { @@ -318,6 +319,34 @@ struct GR_CORE_API gr_block : gras::Block } } + /*! Used by block's setters and work functions to make + * setting/resetting of parameters thread-safe. + * + * Used by calling gruel::scoped_lock l(d_setlock); + */ + gruel::mutex d_setlock; + + // ---------------------------------------------------------------------------- + // Functions to handle thread affinity + std::vector d_affinity; // thread affinity proc. mask + + /*! + * \brief Set the thread's affinity to processor core \p n. + * + * \param mask a vector of unsigned ints of the core numbers available to this block. + */ + void set_processor_affinity(const std::vector &mask){d_affinity=mask;} + + /*! + * \brief Remove processor affinity to a specific core. + */ + void unset_processor_affinity(){} + + /*! + * \brief Get the current processor affinity. + */ + std::vector processor_affinity() { return d_affinity; } + ///////////////// private vars ////////////////////// gr_vector_int _work_ninput_items; -- cgit