summaryrefslogtreecommitdiff
path: root/lib/top_block.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/top_block.cpp')
-rw-r--r--lib/top_block.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/top_block.cpp b/lib/top_block.cpp
index 440b7fa..306e152 100644
--- a/lib/top_block.cpp
+++ b/lib/top_block.cpp
@@ -91,7 +91,10 @@ void TopBlock::start(void)
void TopBlock::stop(void)
{
+ //interrupt these "special" threads
(*this)->thread_group->interrupt_all();
+
+ //message all blocks to mark done
TopBlockMessage event;
event.what = TopBlockMessage::INERT;
(*this)->executor.post_msg(event);
@@ -105,11 +108,13 @@ void TopBlock::run(void)
void TopBlock::wait(void)
{
+ //We do not need to join "special" threads;
+ //the token mechainism will do just fine.
//(*this)->thread_group->join_all();
+
+ //wait for all blocks to release the token
while (not (*this)->token.unique())
{
boost::this_thread::yield();
- //sleep(1);
- //VAR((*this)->token.use_count());
}
}