|
|
| 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 (); |