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

(-)a/src/core/model/default-simulator-impl.cc (+22 lines)
 Lines 81-86    Link Here 
81
void
81
void
82
DefaultSimulatorImpl::Destroy ()
82
DefaultSimulatorImpl::Destroy ()
83
{
83
{
84
  while (!m_destroyWithContextEvents.empty ())
85
    {
86
      EventId event = m_destroyWithContextEvents.front ();
87
      Ptr<EventImpl> ev = event.PeekEventImpl ();
88
      m_destroyWithContextEvents.pop_front ();
89
      NS_LOG_LOGIC ("handle destroy (context) " << ev);
90
      if (!ev->IsCancelled ())
91
        {
92
          m_currentContext = event.GetContext ();
93
          ev->Invoke ();
94
        }
95
    }
96
  m_currentContext = 0xffffffff;
84
  while (!m_destroyEvents.empty ()) 
97
  while (!m_destroyEvents.empty ()) 
85
    {
98
    {
86
      Ptr<EventImpl> ev = m_destroyEvents.front ().PeekEventImpl ();
99
      Ptr<EventImpl> ev = m_destroyEvents.front ().PeekEventImpl ();
 Lines 281-286    Link Here 
281
  return id;
294
  return id;
282
}
295
}
283
296
297
EventId
298
DefaultSimulatorImpl::ScheduleDestroyWithContext (uint32_t context, EventImpl *event)
299
{
300
  EventId id (Ptr<EventImpl> (event, false), m_currentTs, context, 2);
301
  m_destroyWithContextEvents.push_back (id);
302
  m_uid++;
303
  return id;
304
}
305
284
Time
306
Time
285
DefaultSimulatorImpl::Now (void) const
307
DefaultSimulatorImpl::Now (void) const
286
{
308
{
(-)a/src/core/model/default-simulator-impl.h (+2 lines)
 Lines 59-64    Link Here 
59
  virtual void SetScheduler (ObjectFactory schedulerFactory);
59
  virtual void SetScheduler (ObjectFactory schedulerFactory);
60
  virtual uint32_t GetSystemId (void) const; 
60
  virtual uint32_t GetSystemId (void) const; 
61
  virtual uint32_t GetContext (void) const;
61
  virtual uint32_t GetContext (void) const;
62
  EventId ScheduleDestroyWithContext (uint32_t context, EventImpl *event);
62
63
63
private:
64
private:
64
  virtual void DoDispose (void);
65
  virtual void DoDispose (void);
 Lines 77-82    Link Here 
77
78
78
  typedef std::list<EventId> DestroyEvents;
79
  typedef std::list<EventId> DestroyEvents;
79
  DestroyEvents m_destroyEvents;
80
  DestroyEvents m_destroyEvents;
81
  DestroyEvents m_destroyWithContextEvents;
80
  bool m_stop;
82
  bool m_stop;
81
  Ptr<Scheduler> m_events;
83
  Ptr<Scheduler> m_events;
82
84

Return to bug 1594