Left: | ||
Right: |
LEFT | RIGHT |
---|---|
(no file at all) | |
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 355 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 ())) |
Peter Barnes
2018/05/11 21:58:12
Time::GetTimeStep returns int64_t. Can we change
ammo6818-vandals.uidaho.edu
2018/05/16 15:06:29
Making the suggested change causes a number of oth
| |
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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
426 "RealtimeSimulatorImpl::Run(): Simulator already running"); | 426 "RealtimeSimulatorImpl::Run(): Simulator already running"); |
427 | 427 |
428 // Set the current threadId as the main threadId | 428 // Set the current threadId as the main threadId |
429 m_main = SystemThread::Self(); | 429 m_main = SystemThread::Self(); |
430 | 430 |
431 m_stop = false; | 431 m_stop = false; |
432 m_running = true; | 432 m_running = true; |
433 m_synchronizer->SetOrigin (m_currentTs); | 433 m_synchronizer->SetOrigin (m_currentTs); |
434 | 434 |
435 // Sleep until signalled | 435 // Sleep until signalled |
436 uint64_t tsNow; | 436 uint64_t tsNow = 0; |
437 uint64_t tsDelay = 1000000000; // wait time of 1 second (in nanoseconds) | 437 uint64_t tsDelay = 1000000000; // wait time of 1 second (in nanoseconds) |
438 · | 438 · |
439 while (!m_stop)· | 439 while (!m_stop)· |
440 { | 440 { |
441 bool process = false; | 441 bool process = false; |
442 { | 442 { |
443 CriticalSection cs (m_mutex); | 443 CriticalSection cs (m_mutex); |
444 | 444 |
445 if (!m_events->IsEmpty ()) | 445 if (!m_events->IsEmpty ()) |
446 { | 446 { |
(...skipping 393 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 |