LEFT | RIGHT |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2008 University of Washington | 3 * Copyright (c) 2008 University of Washington |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 5 * This program is free software; you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 2 as | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 m_stop = false; | 81 m_stop = false; |
82 m_running = false; | 82 m_running = false; |
83 // uids are allocated from 4. | 83 // uids are allocated from 4. |
84 // uid 0 is "invalid" events | 84 // uid 0 is "invalid" events |
85 // uid 1 is "now" events | 85 // uid 1 is "now" events |
86 // uid 2 is "destroy" events | 86 // uid 2 is "destroy" events |
87 m_uid = 4;· | 87 m_uid = 4;· |
88 // before ::Run is entered, the m_currentUid will be zero | 88 // before ::Run is entered, the m_currentUid will be zero |
89 m_currentUid = 0; | 89 m_currentUid = 0; |
90 m_currentTs = 0; | 90 m_currentTs = 0; |
91 m_currentContext = (uint32_t)Simulator::NO_CONTEXT; | 91 m_currentContext = Simulator::NO_CONTEXT; |
92 m_unscheduledEvents = 0; | 92 m_unscheduledEvents = 0; |
93 | 93 |
94 m_main = SystemThread::Self(); | 94 m_main = SystemThread::Self(); |
95 | 95 |
96 // Be very careful not to do anything that would cause a change or assignment | 96 // Be very careful not to do anything that would cause a change or assignment |
97 // of the underlying reference counts of m_synchronizer or you will be sorry. | 97 // of the underlying reference counts of m_synchronizer or you will be sorry. |
98 m_synchronizer = CreateObject<WallClockSynchronizer> (); | 98 m_synchronizer = CreateObject<WallClockSynchronizer> (); |
99 } | 99 } |
100 | 100 |
101 RealtimeSimulatorImpl::~RealtimeSimulatorImpl () | 101 RealtimeSimulatorImpl::~RealtimeSimulatorImpl () |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 | 366 |
367 if (tsFinal >= m_currentTs) | 367 if (tsFinal >= m_currentTs) |
368 { | 368 { |
369 tsJitter = tsFinal - m_currentTs; | 369 tsJitter = tsFinal - m_currentTs; |
370 } | 370 } |
371 else | 371 else |
372 { | 372 { |
373 tsJitter = m_currentTs - tsFinal; | 373 tsJitter = m_currentTs - tsFinal; |
374 } | 374 } |
375 | 375 |
376 if (tsJitter > static_cast<uint64_t>(m_hardLimit.GetTimeStep ())) | 376 if (tsJitter > static_cast<uint64_t> (m_hardLimit.GetTimeStep ())) |
377 { | 377 { |
378 NS_FATAL_ERROR ("RealtimeSimulatorImpl::ProcessOneEvent (): " | 378 NS_FATAL_ERROR ("RealtimeSimulatorImpl::ProcessOneEvent (): " |
379 "Hard real-time limit exceeded (jitter = " << tsJitt
er << ")"); | 379 "Hard real-time limit exceeded (jitter = " << tsJitt
er << ")"); |
380 } | 380 } |
381 } | 381 } |
382 } | 382 } |
383 | 383 |
384 // | 384 // |
385 // We have got the event we're about to execute completely disentangled from t
he· | 385 // We have got the event we're about to execute completely disentangled from t
he· |
386 // event list so we can execute it outside a critical section without fear of
someone | 386 // event list so we can execute it outside a critical section without fear of
someone |
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
840 } | 840 } |
841 | 841 |
842 Time | 842 Time |
843 RealtimeSimulatorImpl::GetHardLimit (void) const | 843 RealtimeSimulatorImpl::GetHardLimit (void) const |
844 { | 844 { |
845 NS_LOG_FUNCTION (this); | 845 NS_LOG_FUNCTION (this); |
846 return m_hardLimit; | 846 return m_hardLimit; |
847 } | 847 } |
848 | 848 |
849 } // namespace ns3 | 849 } // namespace ns3 |
LEFT | RIGHT |