Make Simulator::IsFinished () take into account the stop time. Needed to run custom simulation loops (see bug 375)

This commit is contained in:
Gustavo J. A. M. Carneiro
2009-01-13 19:27:44 +00:00
parent dd94e9fa76
commit a374c0f03e
3 changed files with 5 additions and 4 deletions

View File

@@ -124,7 +124,7 @@ DefaultSimulatorImpl::ProcessOneEvent (void)
bool
DefaultSimulatorImpl::IsFinished (void) const
{
return m_events->IsEmpty ();
return m_events->IsEmpty () || m_stop;
}
uint64_t

View File

@@ -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;

View File

@@ -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);
/**