View | Details | Raw Unified | Return to bug 1000
Collapse All | Expand All

(-)a/examples/realtime/realtime-udp-echo.cc (+1 lines)
 Lines 113-118    Link Here 
113
  // Now, do the actual simulation.
113
  // Now, do the actual simulation.
114
  //
114
  //
115
  NS_LOG_INFO ("Run Simulation.");
115
  NS_LOG_INFO ("Run Simulation.");
116
  Simulator::Stop (Seconds(10.));
116
  Simulator::Run ();
117
  Simulator::Run ();
117
  Simulator::Destroy ();
118
  Simulator::Destroy ();
118
  NS_LOG_INFO ("Done.");
119
  NS_LOG_INFO ("Done.");
(-)a/src/simulator/realtime-simulator-impl.cc (-12 / +7 lines)
 Lines 427-453    Link Here 
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 ();

Return to bug 1000