summaryrefslogtreecommitdiff
path: root/lib/block_handlers.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/block_handlers.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/block_handlers.cpp')
-rw-r--r--lib/block_handlers.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/block_handlers.cpp b/lib/block_handlers.cpp
index a6d49bb..7a5b0d7 100644
--- a/lib/block_handlers.cpp
+++ b/lib/block_handlers.cpp
@@ -19,7 +19,6 @@ void BlockActor::handle_top_active(
this->stats.start_time = time_now();
}
this->block_state = BLOCK_STATE_LIVE;
- this->active_token = message.token;
this->Send(0, from); //ACK
@@ -32,6 +31,8 @@ void BlockActor::handle_top_inert(
){
MESSAGE_TRACER();
+ ASSERT(this->prio_count.Load() != 0);
+ this->prio_count.Decrement();
this->mark_done();
this->Send(0, from); //ACK
@@ -134,6 +135,8 @@ void BlockActor::handle_get_stats(
const GetStatsMessage &,
const Theron::Address from
){
+ MESSAGE_TRACER();
+ this->prio_count.Decrement();
GetStatsMessage message;
message.block_id = this->block_ptr->to_string();
message.stats = this->stats;