Make Simulator::IsFinished () take into account the stop time. Needed to run custom simulation loops (see bug 375)
This commit is contained in:
@@ -124,7 +124,7 @@ DefaultSimulatorImpl::ProcessOneEvent (void)
|
||||
bool
|
||||
DefaultSimulatorImpl::IsFinished (void) const
|
||||
{
|
||||
return m_events->IsEmpty ();
|
||||
return m_events->IsEmpty () || m_stop;
|
||||
}
|
||||
|
||||
uint64_t
|
||||
|
||||
@@ -384,7 +384,7 @@ RealtimeSimulatorImpl::IsFinished (void) const
|
||||
bool rc;
|
||||
{
|
||||
CriticalSection cs (m_mutex);
|
||||
rc = m_events->IsEmpty ();
|
||||
rc = m_events->IsEmpty () || m_stop;
|
||||
}
|
||||
|
||||
return rc;
|
||||
|
||||
@@ -97,8 +97,9 @@ public:
|
||||
static void Destroy (void);
|
||||
|
||||
/**
|
||||
* If there any any events lefts to be scheduled, return
|
||||
* true. Return false otherwise.
|
||||
* If there any any events lefts to be scheduled and simulation time
|
||||
* has not yet reached the "stop time" (see Simulator::Stop()),
|
||||
* return true. Return false otherwise.
|
||||
*/
|
||||
static bool IsFinished (void);
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user