--- a/samples/main-test-sync.cc Fri Oct 10 16:43:43 2008 -0700
+++ b/samples/main-test-sync.cc Fri Oct 10 21:01:50 2008 -0700
@@ -126,9 +126,9 @@
FakeNetDevice fnd;
//
- // Make sure ScheduleNow works when the system isn't running
+ // Make sure ScheduleRealNow works when the system isn't running
//
- Simulator::ScheduleNow(&first_function);
+ RealtimeSimulatorExtension::ScheduleRealNow(&first_function);
//
// drive the progression of m_currentTs at a ten millisecond rate
--- a/src/simulator/realtime-simulator-impl.cc Fri Oct 10 16:43:43 2008 -0700
+++ b/src/simulator/realtime-simulator-impl.cc Fri Oct 10 21:01:50 2008 -0700
@@ -657,7 +657,11 @@
{
CriticalSection cs (m_mutex);
- uint64_t ts = m_synchronizer->GetCurrentRealtime ();
+ //
+ // If the simulator is running, we're pacing and have a meaningful
+ // realtime clock. If we're not, then m_currentTs is were we stopped.
+ //
+ uint64_t ts = m_running ? m_synchronizer->GetCurrentRealtime () : m_currentTs;
NS_ASSERT_MSG (ts >= m_currentTs, "RealtimeSimulatorImpl::ScheduleRealNow(): schedule for time < m_currentTs");
id = EventId (event, ts, m_uid);
m_uid++;