summaryrefslogtreecommitdiff
path: root/lib/element_impl.hpp
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/element_impl.hpp
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/element_impl.hpp')
-rw-r--r--lib/element_impl.hpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/element_impl.hpp b/lib/element_impl.hpp
index c707268..e127e01 100644
--- a/lib/element_impl.hpp
+++ b/lib/element_impl.hpp
@@ -10,6 +10,7 @@
#include <gras/block.hpp>
#include <gras_impl/token.hpp>
#include <gras_impl/interruptible_thread.hpp>
+#include <boost/foreach.hpp>
namespace gras
{
@@ -31,7 +32,6 @@ struct ElementImpl
//top block stuff
SharedThreadGroup thread_group;
Token token;
- Token active_token;
GlobalBlockConfig top_config;
//things may be in this element
@@ -45,6 +45,14 @@ struct ElementImpl
return topology.get();
}
+ //call this before sending a high prio message to all workers
+ void pre_post_all_set_prio(void)
+ {
+ BOOST_FOREACH(Apology::Worker *worker, this->executor->get_workers())
+ {
+ dynamic_cast<BlockActor *>(worker)->prio_count.Increment();
+ }
+ }
};