forked from ROMEO/nexosim
Change after review.
This commit is contained in:
parent
922d93bd01
commit
a223a14cc6
@ -427,17 +427,14 @@ impl Simulation {
|
|||||||
action
|
action
|
||||||
}
|
}
|
||||||
|
|
||||||
let (unbounded, upper_time_bound) = match upper_time_bound {
|
let upper_time_bound = upper_time_bound.unwrap_or(MonotonicTime::MAX);
|
||||||
Some(upper_time_bound) => (false, upper_time_bound),
|
|
||||||
None => (true, MonotonicTime::MAX),
|
|
||||||
};
|
|
||||||
|
|
||||||
// Closure returning the next key which time stamp is no older than the
|
// Closure returning the next key which time stamp is no older than the
|
||||||
// upper bound, if any. Cancelled actions are pulled and discarded.
|
// upper bound, if any. Cancelled actions are pulled and discarded.
|
||||||
let peek_next_key = |scheduler_queue: &mut MutexGuard<SchedulerQueue>| {
|
let peek_next_key = |scheduler_queue: &mut MutexGuard<SchedulerQueue>| {
|
||||||
loop {
|
loop {
|
||||||
match scheduler_queue.peek() {
|
match scheduler_queue.peek() {
|
||||||
Some((&key, action)) if unbounded || key.0 <= upper_time_bound => {
|
Some((&key, action)) if key.0 <= upper_time_bound => {
|
||||||
if !action.is_cancelled() {
|
if !action.is_cancelled() {
|
||||||
break Some(key);
|
break Some(key);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user