summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/block.cpp6
-rw-r--r--lib/block_handlers.cpp2
-rw-r--r--lib/gras_impl/block_actor.hpp1
3 files changed, 8 insertions, 1 deletions
diff --git a/lib/block.cpp b/lib/block.cpp
index 75fd910..dce8f8e 100644
--- a/lib/block.cpp
+++ b/lib/block.cpp
@@ -43,6 +43,7 @@ Block::Block(const std::string &name):
this->set_fixed_rate(true);
this->set_relative_rate(1.0);
this->set_tag_propagation_policy(TPP_ALL_TO_ALL);
+ this->set_interruptible_work(false);
}
template <typename V, typename T>
@@ -238,3 +239,8 @@ void Block::set_buffer_affinity(const Affinity &affinity)
{
(*this)->block->buffer_affinity = affinity;
}
+
+void Block::set_interruptible_work(const bool enb)
+{
+ (*this)->block->interruptible_work = enb;
+}
diff --git a/lib/block_handlers.cpp b/lib/block_handlers.cpp
index 694f781..eeb54aa 100644
--- a/lib/block_handlers.cpp
+++ b/lib/block_handlers.cpp
@@ -130,7 +130,7 @@ void BlockActor::handle_top_thread_group(
//spawn a new thread if this block is a source
this->thread_group = message;
this->interruptible_thread.reset(); //erase old one
- if (this->get_num_inputs() == 0) //its a source
+ if (this->interruptible_work)
{
this->interruptible_thread = boost::make_shared<InterruptibleThread>(
this->thread_group, boost::bind(&BlockActor::task_work, this)
diff --git a/lib/gras_impl/block_actor.hpp b/lib/gras_impl/block_actor.hpp
index 745483f..dada926 100644
--- a/lib/gras_impl/block_actor.hpp
+++ b/lib/gras_impl/block_actor.hpp
@@ -163,6 +163,7 @@ struct BlockActor : Apology::Worker
Block::tag_propagation_policy_t tag_prop_policy;
//interruptible thread stuff
+ bool interruptible_work;
SharedThreadGroup thread_group;
boost::shared_ptr<InterruptibleThread> interruptible_thread;