diff options
| author | 2019-06-15 10:12:41 -0400 | |
|---|---|---|
| committer | 2019-06-16 14:14:35 -0400 | |
| commit | 90792cdb6ea8f1676bd54309767209a4ec84a46f (patch) | |
| tree | eae330371459c0f9b71fcbf1c68e2fb01d19e294 /src/tests | |
| parent | Merge pull request #2578 from lioncash/cnmt (diff) | |
| download | yuzu-90792cdb6ea8f1676bd54309767209a4ec84a46f.tar.gz yuzu-90792cdb6ea8f1676bd54309767209a4ec84a46f.tar.xz yuzu-90792cdb6ea8f1676bd54309767209a4ec84a46f.zip | |
Core_Timing: Make core_timing threadsafe by default.
The old implementation had faulty Threadsafe methods where events could
be missing. This implementation unifies unsafe/safe methods and makes
core timing thread safe overall.
Diffstat (limited to 'src/tests')
| -rw-r--r-- | src/tests/core/core_timing.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/tests/core/core_timing.cpp b/src/tests/core/core_timing.cpp index 340d6a272..f8be8fd19 100644 --- a/src/tests/core/core_timing.cpp +++ b/src/tests/core/core_timing.cpp | |||
| @@ -99,24 +99,24 @@ TEST_CASE("CoreTiming[Threadsave]", "[core]") { | |||
| 99 | core_timing.Advance(); | 99 | core_timing.Advance(); |
| 100 | 100 | ||
| 101 | // D -> B -> C -> A -> E | 101 | // D -> B -> C -> A -> E |
| 102 | core_timing.ScheduleEventThreadsafe(1000, cb_a, CB_IDS[0]); | 102 | core_timing.ScheduleEvent(1000, cb_a, CB_IDS[0]); |
| 103 | // Manually force since ScheduleEventThreadsafe doesn't call it | 103 | // Manually force since ScheduleEvent doesn't call it |
| 104 | core_timing.ForceExceptionCheck(1000); | 104 | core_timing.ForceExceptionCheck(1000); |
| 105 | REQUIRE(1000 == core_timing.GetDowncount()); | 105 | REQUIRE(1000 == core_timing.GetDowncount()); |
| 106 | core_timing.ScheduleEventThreadsafe(500, cb_b, CB_IDS[1]); | 106 | core_timing.ScheduleEvent(500, cb_b, CB_IDS[1]); |
| 107 | // Manually force since ScheduleEventThreadsafe doesn't call it | 107 | // Manually force since ScheduleEvent doesn't call it |
| 108 | core_timing.ForceExceptionCheck(500); | 108 | core_timing.ForceExceptionCheck(500); |
| 109 | REQUIRE(500 == core_timing.GetDowncount()); | 109 | REQUIRE(500 == core_timing.GetDowncount()); |
| 110 | core_timing.ScheduleEventThreadsafe(800, cb_c, CB_IDS[2]); | 110 | core_timing.ScheduleEvent(800, cb_c, CB_IDS[2]); |
| 111 | // Manually force since ScheduleEventThreadsafe doesn't call it | 111 | // Manually force since ScheduleEvent doesn't call it |
| 112 | core_timing.ForceExceptionCheck(800); | 112 | core_timing.ForceExceptionCheck(800); |
| 113 | REQUIRE(500 == core_timing.GetDowncount()); | 113 | REQUIRE(500 == core_timing.GetDowncount()); |
| 114 | core_timing.ScheduleEventThreadsafe(100, cb_d, CB_IDS[3]); | 114 | core_timing.ScheduleEvent(100, cb_d, CB_IDS[3]); |
| 115 | // Manually force since ScheduleEventThreadsafe doesn't call it | 115 | // Manually force since ScheduleEvent doesn't call it |
| 116 | core_timing.ForceExceptionCheck(100); | 116 | core_timing.ForceExceptionCheck(100); |
| 117 | REQUIRE(100 == core_timing.GetDowncount()); | 117 | REQUIRE(100 == core_timing.GetDowncount()); |
| 118 | core_timing.ScheduleEventThreadsafe(1200, cb_e, CB_IDS[4]); | 118 | core_timing.ScheduleEvent(1200, cb_e, CB_IDS[4]); |
| 119 | // Manually force since ScheduleEventThreadsafe doesn't call it | 119 | // Manually force since ScheduleEvent doesn't call it |
| 120 | core_timing.ForceExceptionCheck(1200); | 120 | core_timing.ForceExceptionCheck(1200); |
| 121 | REQUIRE(100 == core_timing.GetDowncount()); | 121 | REQUIRE(100 == core_timing.GetDowncount()); |
| 122 | 122 | ||