diff options
| author | 2021-11-28 12:21:45 +0100 | |
|---|---|---|
| committer | 2022-06-28 01:10:55 +0200 | |
| commit | 9cafb0d91266210dab2c72e484b493bceae1cb02 (patch) | |
| tree | b7a350271073804162c41254ff1889c8ec2a76bf | |
| parent | Core: add missing include. (diff) | |
| download | yuzu-9cafb0d91266210dab2c72e484b493bceae1cb02.tar.gz yuzu-9cafb0d91266210dab2c72e484b493bceae1cb02.tar.xz yuzu-9cafb0d91266210dab2c72e484b493bceae1cb02.zip | |
Core: Fix tests.
Diffstat (limited to '')
| -rw-r--r-- | src/common/thread.cpp | 3 | ||||
| -rw-r--r-- | src/common/x64/native_clock.cpp | 1 | ||||
| -rw-r--r-- | src/tests/core/core_timing.cpp | 3 |
3 files changed, 5 insertions, 2 deletions
diff --git a/src/common/thread.cpp b/src/common/thread.cpp index 924f0df1b..919e33af9 100644 --- a/src/common/thread.cpp +++ b/src/common/thread.cpp | |||
| @@ -62,8 +62,7 @@ void SetCurrentThreadPriority(ThreadPriority new_priority) { | |||
| 62 | void SetCurrentThreadPriority(ThreadPriority new_priority) { | 62 | void SetCurrentThreadPriority(ThreadPriority new_priority) { |
| 63 | pthread_t this_thread = pthread_self(); | 63 | pthread_t this_thread = pthread_self(); |
| 64 | 64 | ||
| 65 | const auto scheduling_type = | 65 | const auto scheduling_type = SCHED_OTHER; |
| 66 | new_priority != ThreadPriority::Critical ? SCHED_OTHER : SCHED_FIFO; | ||
| 67 | s32 max_prio = sched_get_priority_max(scheduling_type); | 66 | s32 max_prio = sched_get_priority_max(scheduling_type); |
| 68 | s32 min_prio = sched_get_priority_min(scheduling_type); | 67 | s32 min_prio = sched_get_priority_min(scheduling_type); |
| 69 | u32 level = std::max(static_cast<u32>(new_priority) + 1, 4U); | 68 | u32 level = std::max(static_cast<u32>(new_priority) + 1, 4U); |
diff --git a/src/common/x64/native_clock.cpp b/src/common/x64/native_clock.cpp index 427a382cd..0b89f9ed2 100644 --- a/src/common/x64/native_clock.cpp +++ b/src/common/x64/native_clock.cpp | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | #include <chrono> | 5 | #include <chrono> |
| 6 | #include <thread> | 6 | #include <thread> |
| 7 | 7 | ||
| 8 | #include "common/atomic_ops.h" | ||
| 8 | #include "common/uint128.h" | 9 | #include "common/uint128.h" |
| 9 | #include "common/x64/native_clock.h" | 10 | #include "common/x64/native_clock.h" |
| 10 | 11 | ||
diff --git a/src/tests/core/core_timing.cpp b/src/tests/core/core_timing.cpp index 62eb43753..e687416a8 100644 --- a/src/tests/core/core_timing.cpp +++ b/src/tests/core/core_timing.cpp | |||
| @@ -8,6 +8,7 @@ | |||
| 8 | #include <chrono> | 8 | #include <chrono> |
| 9 | #include <cstdlib> | 9 | #include <cstdlib> |
| 10 | #include <memory> | 10 | #include <memory> |
| 11 | #include <mutex> | ||
| 11 | #include <string> | 12 | #include <string> |
| 12 | 13 | ||
| 13 | #include "core/core.h" | 14 | #include "core/core.h" |
| @@ -21,9 +22,11 @@ std::array<s64, 5> delays{}; | |||
| 21 | 22 | ||
| 22 | std::bitset<CB_IDS.size()> callbacks_ran_flags; | 23 | std::bitset<CB_IDS.size()> callbacks_ran_flags; |
| 23 | u64 expected_callback = 0; | 24 | u64 expected_callback = 0; |
| 25 | std::mutex control_mutex; | ||
| 24 | 26 | ||
| 25 | template <unsigned int IDX> | 27 | template <unsigned int IDX> |
| 26 | void HostCallbackTemplate(std::uintptr_t user_data, std::chrono::nanoseconds ns_late) { | 28 | void HostCallbackTemplate(std::uintptr_t user_data, std::chrono::nanoseconds ns_late) { |
| 29 | std::unique_lock<std::mutex> lk(control_mutex); | ||
| 27 | static_assert(IDX < CB_IDS.size(), "IDX out of range"); | 30 | static_assert(IDX < CB_IDS.size(), "IDX out of range"); |
| 28 | callbacks_ran_flags.set(IDX); | 31 | callbacks_ran_flags.set(IDX); |
| 29 | REQUIRE(CB_IDS[IDX] == user_data); | 32 | REQUIRE(CB_IDS[IDX] == user_data); |