From bef519421c345d99b29200d54f02cf0512b2c52e Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Fri, 15 Mar 2013 23:29:11 -0700 Subject: 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 --- lib/element_impl.hpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'lib/element_impl.hpp') 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 #include #include +#include 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(worker)->prio_count.Increment(); + } + } }; -- cgit