|
|
| 427 |
m_running = true; |
427 |
m_running = true; |
| 428 |
m_synchronizer->SetOrigin (m_currentTs); |
428 |
m_synchronizer->SetOrigin (m_currentTs); |
| 429 |
|
429 |
|
| 430 |
for (;;) |
430 |
while (!m_stop) |
| 431 |
{ |
431 |
{ |
| 432 |
bool done = false; |
432 |
bool process = false; |
| 433 |
|
433 |
|
| 434 |
{ |
434 |
{ |
| 435 |
CriticalSection cs (m_mutex); |
435 |
CriticalSection cs (m_mutex); |
| 436 |
// |
436 |
|
| 437 |
// In all cases we stop when the event list is empty. If you are doing a |
437 |
if (!m_events->IsEmpty ()) |
| 438 |
// realtime simulation and you want it to extend out for some time, you must |
|
|
| 439 |
// call StopAt. In the realtime case, this will stick a placeholder event out |
| 440 |
// at the end of time. |
| 441 |
// |
| 442 |
if (m_stop || m_events->IsEmpty ()) |
| 443 |
{ |
438 |
{ |
| 444 |
done = true; |
439 |
process = true; |
| 445 |
} |
440 |
} |
| 446 |
} |
441 |
} |
| 447 |
|
442 |
|
| 448 |
if (done) |
443 |
if (!process) |
| 449 |
{ |
444 |
{ |
| 450 |
break; |
445 |
continue; |
| 451 |
} |
446 |
} |
| 452 |
|
447 |
|
| 453 |
ProcessOneEvent (); |
448 |
ProcessOneEvent (); |