Fix worst slack queue corruption (#154)
Signed-off-by: Martin Povišer <povik@cutebit.org>
This commit is contained in:
parent
3dd38ad159
commit
c39f8ab1ac
|
|
@ -265,8 +265,9 @@ WorstSlack::updateWorstSlack(Vertex *vertex,
|
||||||
SlackSeq &slacks,
|
SlackSeq &slacks,
|
||||||
PathAPIndex path_ap_index)
|
PathAPIndex path_ap_index)
|
||||||
{
|
{
|
||||||
|
// Do not touch the state unless queue has been initialized
|
||||||
|
if (!queue_->empty()) {
|
||||||
Slack slack = slacks[path_ap_index];
|
Slack slack = slacks[path_ap_index];
|
||||||
|
|
||||||
// Locking is required because ArrivalVisitor is called by multiple
|
// Locking is required because ArrivalVisitor is called by multiple
|
||||||
// threads.
|
// threads.
|
||||||
LockGuard lock(lock_);
|
LockGuard lock(lock_);
|
||||||
|
|
@ -290,7 +291,8 @@ WorstSlack::updateWorstSlack(Vertex *vertex,
|
||||||
delayAsString(slack, this));
|
delayAsString(slack, this));
|
||||||
queue_->erase(vertex);
|
queue_->erase(vertex);
|
||||||
}
|
}
|
||||||
// checkQueue();
|
//checkQueue(path_ap_index);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue