Skip to content

Commit 5fe81db

Browse files
committed
SettableClock: Enforced re-scheduling events in compareClockEvents order.
1 parent 1ae6010 commit 5fe81db

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/inet/clock/model/SettableClock.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ void SettableClock::setClockTime(clocktime_t newClockTime, ppm oscillatorCompens
108108
this->oscillatorCompensation = oscillatorCompensation;
109109
ASSERT(newClockTime == getClockTime());
110110
clocktime_t clockDelta = newClockTime - oldClockTime;
111+
std::sort(events.begin(), events.end(), [] (auto &a, auto &b) { return compareClockEvents(b, a); });
111112
for (auto event : events) {
112113
if (event->getRelative())
113114
// NOTE: the simulation time of event execution is not affected

0 commit comments

Comments
 (0)