summaryrefslogtreecommitdiff
path: root/gnuradio-core/src/lib/runtime
diff options
context:
space:
mode:
authorJosh Blum2013-03-17 23:46:55 -0700
committerJosh Blum2013-03-17 23:46:55 -0700
commite3379b56d48f149df81760b897bbf0d562cef848 (patch)
tree48ecf6fe43100255aa223a9f709094063c4ca18c /gnuradio-core/src/lib/runtime
parente8a55993675d6d1fd095c2e99d4934329caa1358 (diff)
downloadgnuradio-e3379b56d48f149df81760b897bbf0d562cef848.tar.gz
gnuradio-e3379b56d48f149df81760b897bbf0d562cef848.tar.bz2
gnuradio-e3379b56d48f149df81760b897bbf0d562cef848.zip
gras: more changes to get compiling w/ maint
Diffstat (limited to 'gnuradio-core/src/lib/runtime')
-rw-r--r--gnuradio-core/src/lib/runtime/gr_block.h29
-rw-r--r--gnuradio-core/src/lib/runtime/runtime.i1
2 files changed, 30 insertions, 0 deletions
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 <deque>
#include <map>
#include <boost/foreach.hpp>
+#include <gruel/thread.h>
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<unsigned int> 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<unsigned int> &mask){d_affinity=mask;}
+
+ /*!
+ * \brief Remove processor affinity to a specific core.
+ */
+ void unset_processor_affinity(){}
+
+ /*!
+ * \brief Get the current processor affinity.
+ */
+ std::vector<unsigned int> processor_affinity() { return d_affinity; }
+
///////////////// private vars //////////////////////
gr_vector_int _work_ninput_items;
diff --git a/gnuradio-core/src/lib/runtime/runtime.i b/gnuradio-core/src/lib/runtime/runtime.i
index d69122341..935b43742 100644
--- a/gnuradio-core/src/lib/runtime/runtime.i
+++ b/gnuradio-core/src/lib/runtime/runtime.i
@@ -20,6 +20,7 @@
%ignore gri_agc_cc::reference();
%ignore gri_agc2_ff::reference();
%ignore gri_agc2_cc::reference();
+%ignore gr_block::d_setlock;
%{