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, 8 insertions, 1 deletions
diff --git a/lib/top_block.cpp b/lib/top_block.cpp
index 345c46b..4f4ca67 100644
--- a/lib/top_block.cpp
+++ b/lib/top_block.cpp
@@ -76,12 +76,19 @@ void TopBlock::start(void)
(*this)->executor->post_all(TopAllocMessage());
}
{
- (*this)->executor->post_all(TopActiveMessage());
+ TopActiveMessage message;
+ message.token = Token::make();
+ (*this)->active_token = message.token;
+ (*this)->executor->post_all(message);
}
}
void TopBlock::stop(void)
{
+ //reset only reference to active token
+ //workers about to call work see expired
+ (*this)->active_token.reset();
+
//interrupt these "special" threads
(*this)->thread_group->interrupt_all();