View | Details | Raw Unified | Return to bug 2598
Collapse All | Expand All

(-)a/src/core/model/default-simulator-impl.cc (-2 / +1 lines)
 Lines 230-239    Link Here 
230
  NS_LOG_FUNCTION (this << delay.GetTimeStep () << event);
230
  NS_LOG_FUNCTION (this << delay.GetTimeStep () << event);
231
  NS_ASSERT_MSG (SystemThread::Equals (m_main), "Simulator::Schedule Thread-unsafe invocation!");
231
  NS_ASSERT_MSG (SystemThread::Equals (m_main), "Simulator::Schedule Thread-unsafe invocation!");
232
232
233
  NS_ASSERT_MSG (delay.IsPositive (), "DefaultSimulatorImpl::Schedule(): Negative delay");
233
  Time tAbsolute = delay + TimeStep (m_currentTs);
234
  Time tAbsolute = delay + TimeStep (m_currentTs);
234
235
235
  NS_ASSERT (tAbsolute.IsPositive ());
236
  NS_ASSERT (tAbsolute >= TimeStep (m_currentTs));
237
  Scheduler::Event ev;
236
  Scheduler::Event ev;
238
  ev.impl = event;
237
  ev.impl = event;
239
  ev.key.m_ts = (uint64_t) tAbsolute.GetTimeStep ();
238
  ev.key.m_ts = (uint64_t) tAbsolute.GetTimeStep ();
(-)a/src/core/model/realtime-simulator-impl.cc (-3 / +2 lines)
 Lines 517-530    Link Here 
517
  {
517
  {
518
    CriticalSection cs (m_mutex);
518
    CriticalSection cs (m_mutex);
519
    //
519
    //
520
    // This is the reason we had to bring the absolute time calcualtion in from the
520
    // This is the reason we had to bring the absolute time calculation in from the
521
    // simulator.h into the implementation.  Since the implementations may be 
521
    // simulator.h into the implementation.  Since the implementations may be 
522
    // multi-threaded, we need this calculation to be atomic.  You can see it is
522
    // multi-threaded, we need this calculation to be atomic.  You can see it is
523
    // here since we are running in a CriticalSection.
523
    // here since we are running in a CriticalSection.
524
    //
524
    //
525
    NS_ASSERT_MSG (delay.IsPositive (), "RealtimeSimulatorImpl::Schedule(): Negative delay");
525
    Time tAbsolute = Simulator::Now () + delay;
526
    Time tAbsolute = Simulator::Now () + delay;
526
    NS_ASSERT_MSG (tAbsolute.IsPositive (), "RealtimeSimulatorImpl::Schedule(): Negative time");
527
    NS_ASSERT_MSG (tAbsolute >= TimeStep (m_currentTs), "RealtimeSimulatorImpl::Schedule(): time < m_currentTs");
528
    ev.impl = impl;
527
    ev.impl = impl;
529
    ev.key.m_ts = (uint64_t) tAbsolute.GetTimeStep ();
528
    ev.key.m_ts = (uint64_t) tAbsolute.GetTimeStep ();
530
    ev.key.m_context = GetContext ();
529
    ev.key.m_context = GetContext ();

Return to bug 2598