Preventing writers/readers from receiving further messages after a

failure.

Once a writer/reader Do* method has returned false, no further ones
will be executed anymore. This is primarily a safety mechanism to make
it easier for writer/reader authors as otherwise they would often need
to track the failure state themselves (because with the now delayed
termination from the earlier commit, furhter messages can now still
arrive for a little bit).
This commit is contained in:
Robin Sommer 2012-07-26 17:15:10 -07:00
parent 86ae7d8b7c
commit f5862fb014
8 changed files with 63 additions and 7 deletions

View file

@ -154,6 +154,7 @@ MsgThread::MsgThread() : BasicThread(), queue_in(this, 0), queue_out(0, this)
{
cnt_sent_in = cnt_sent_out = 0;
finished = false;
failed = false;
thread_mgr->AddMsgThread(this);
}
@ -363,6 +364,7 @@ void MsgThread::Run()
// error messages have been processed by then main
// thread).
SendOut(new KillMeMessage(this));
failed = true;
}
}