summaryrefslogtreecommitdiff
path: root/lib/top_block.cpp
diff options
context:
space:
mode:
authorJosh Blum2013-03-15 23:29:11 -0700
committerJosh Blum2013-03-15 23:29:11 -0700
commitbef519421c345d99b29200d54f02cf0512b2c52e (patch)
tree793cdf0568b184c624b791554e2194238e8ef18c /lib/top_block.cpp
parent9ded08b79b35fdfd67ad4968121d282e6c3dccda (diff)
downloadsandhi-bef519421c345d99b29200d54f02cf0512b2c52e.tar.gz
sandhi-bef519421c345d99b29200d54f02cf0512b2c52e.tar.bz2
sandhi-bef519421c345d99b29200d54f02cf0512b2c52e.zip
gras: address high prio message issue with atomic count
Both stats and inactive use the atomic count to tell the actor that there is a high prio message in the queue. This is intended to be a workaround; Hopefully Theron will gain API support for message priority stuff. See issue #56
Diffstat (limited to 'lib/top_block.cpp')
-rw-r--r--lib/top_block.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/top_block.cpp b/lib/top_block.cpp
index fe06286..10d5ef2 100644
--- a/lib/top_block.cpp
+++ b/lib/top_block.cpp
@@ -32,6 +32,7 @@ TopBlock::TopBlock(const std::string &name):
void ElementImpl::top_block_cleanup(void)
{
+ this->pre_post_all_set_prio();
this->executor->post_all(TopInertMessage());
this->topology->clear_all();
this->executor->commit();
@@ -77,22 +78,17 @@ void TopBlock::start(void)
}
{
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();
//message all blocks to mark done
+ (*this)->pre_post_all_set_prio();
(*this)->executor->post_all(TopInertMessage());
}