core: forward ScheduleNow(...) to Schedule(0, ...)

This commit is contained in:
Peter Barnes
2021-12-10 22:41:33 +00:00
parent 2c19b5b453
commit c333dbc0cd
4 changed files with 4 additions and 44 deletions

View File

@@ -283,15 +283,7 @@ DefaultSimulatorImpl::ScheduleNow (EventImpl *event)
{
NS_ASSERT_MSG (SystemThread::Equals (m_main), "Simulator::ScheduleNow Thread-unsafe invocation!");
Scheduler::Event ev;
ev.impl = event;
ev.key.m_ts = m_currentTs;
ev.key.m_context = GetContext ();
ev.key.m_uid = m_uid;
m_uid++;
m_unscheduledEvents++;
m_events->Insert (ev);
return EventId (event, ev.key.m_ts, ev.key.m_context, ev.key.m_uid);
return Schedule (Time (0), event);
}
EventId

View File

@@ -579,21 +579,7 @@ EventId
RealtimeSimulatorImpl::ScheduleNow (EventImpl *impl)
{
NS_LOG_FUNCTION (this << impl);
Scheduler::Event ev;
{
CriticalSection cs (m_mutex);
ev.impl = impl;
ev.key.m_ts = m_currentTs;
ev.key.m_context = GetContext ();
ev.key.m_uid = m_uid;
m_uid++;
m_unscheduledEvents++;
m_events->Insert (ev);
m_synchronizer->Signal ();
}
return EventId (impl, ev.key.m_ts, ev.key.m_context, ev.key.m_uid);
return Schedule (Time (0), impl);
}
Time

View File

@@ -508,16 +508,7 @@ EventId
DistributedSimulatorImpl::ScheduleNow (EventImpl *event)
{
NS_LOG_FUNCTION (this << event);
Scheduler::Event ev;
ev.impl = event;
ev.key.m_ts = m_currentTs;
ev.key.m_context = GetContext ();
ev.key.m_uid = m_uid;
m_uid++;
m_unscheduledEvents++;
m_events->Insert (ev);
return EventId (event, ev.key.m_ts, ev.key.m_context, ev.key.m_uid);
return Schedule (Time (0), event);
}
EventId

View File

@@ -438,16 +438,7 @@ EventId
NullMessageSimulatorImpl::ScheduleNow (EventImpl *event)
{
NS_LOG_FUNCTION (this << event);
Scheduler::Event ev;
ev.impl = event;
ev.key.m_ts = m_currentTs;
ev.key.m_context = GetContext ();
ev.key.m_uid = m_uid;
m_uid++;
m_unscheduledEvents++;
m_events->Insert (ev);
return EventId (event, ev.key.m_ts, ev.key.m_context, ev.key.m_uid);
return Schedule (Time (0), event);
}
EventId