[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ns] Incorrect event handling at ns scheduler stop?
Hello!
I have a question about the event queue. I'm afraid an event is lost
everytime the scheduler is stopped. If I understand the source code
correctly, there is a scheduler bug.
scheduler.cc:
| void
| Scheduler::run()
| {
| instance_ = this;
| Event *p;
| while ((p = deque()) && !halted_) {
| dispatch(p);
| }
| }
In the while loop header the next event is taken (p = deque())
and then the halted_ variable is checked. If halted_ is equal
to 1 the scheduler stops its work and the dequeued event is not
handled.
Is my conclusion correct and can I exchange both expressions
in the while header without other side effects?
Yours sincerely
Kaemer