diff options
Diffstat (limited to 'Source/UnitTests/Core/CoreTimingTest.cpp')
| -rw-r--r-- | Source/UnitTests/Core/CoreTimingTest.cpp | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/Source/UnitTests/Core/CoreTimingTest.cpp b/Source/UnitTests/Core/CoreTimingTest.cpp index 67a4f4c716..3b57020ece 100644 --- a/Source/UnitTests/Core/CoreTimingTest.cpp +++ b/Source/UnitTests/Core/CoreTimingTest.cpp @@ -305,17 +305,9 @@ TEST(CoreTiming, ScheduleIntoPast) AdvanceAndCheck(system, 0, MAX_SLICE_LENGTH, 1000); // Run cb_chain into late cb_a - // Schedule late from wrong thread - // The problem with scheduling CPU events from outside the CPU Thread is that g_global_timer - // is not reliable outside the CPU Thread. It's possible for the other thread to sample the - // global timer right before the timer is updated by Advance() then submit a new event using - // the stale value, i.e. effectively half-way through the previous slice. - // NOTE: We're only testing that the scheduler doesn't break, not whether this makes sense. + // Schedule directly into the past from wrong thread. Core::UndeclareAsCPUThread(); - auto& core_timing_globals = core_timing.GetGlobals(); - core_timing_globals.global_timer -= 1000; - core_timing.ScheduleEvent(0, cb_b, CB_IDS[1], CoreTiming::FromThread::NON_CPU); - core_timing_globals.global_timer += 1000; + core_timing.ScheduleEvent(-1000, cb_b, CB_IDS[1], CoreTiming::FromThread::NON_CPU); Core::DeclareAsCPUThread(); AdvanceAndCheck(system, 1, MAX_SLICE_LENGTH, MAX_SLICE_LENGTH + 1000); |
