diff options
author | Fernando S <fsahmkow27@gmail.com> | 2022-06-30 12:38:50 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-30 12:38:50 +0200 |
commit | 603952bc27aca2e17d39def7710d9af36791f15c (patch) | |
tree | 8b6b2f943bbf2fc749dbe144eee26cd144c084c9 /src/tests/core/core_timing.cpp | |
parent | Merge pull request #8518 from yuzu-emu/revert-8379-amd-push-desc-workaround (diff) | |
parent | Adress Feedback. (diff) | |
download | yuzu-603952bc27aca2e17d39def7710d9af36791f15c.tar yuzu-603952bc27aca2e17d39def7710d9af36791f15c.tar.gz yuzu-603952bc27aca2e17d39def7710d9af36791f15c.tar.bz2 yuzu-603952bc27aca2e17d39def7710d9af36791f15c.tar.lz yuzu-603952bc27aca2e17d39def7710d9af36791f15c.tar.xz yuzu-603952bc27aca2e17d39def7710d9af36791f15c.tar.zst yuzu-603952bc27aca2e17d39def7710d9af36791f15c.zip |
Diffstat (limited to '')
-rw-r--r-- | src/tests/core/core_timing.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/tests/core/core_timing.cpp b/src/tests/core/core_timing.cpp index 8358d36b5..e687416a8 100644 --- a/src/tests/core/core_timing.cpp +++ b/src/tests/core/core_timing.cpp @@ -8,6 +8,7 @@ #include <chrono> #include <cstdlib> #include <memory> +#include <mutex> #include <string> #include "core/core.h" @@ -21,13 +22,14 @@ std::array<s64, 5> delays{}; std::bitset<CB_IDS.size()> callbacks_ran_flags; u64 expected_callback = 0; +std::mutex control_mutex; template <unsigned int IDX> void HostCallbackTemplate(std::uintptr_t user_data, std::chrono::nanoseconds ns_late) { + std::unique_lock<std::mutex> lk(control_mutex); static_assert(IDX < CB_IDS.size(), "IDX out of range"); callbacks_ran_flags.set(IDX); REQUIRE(CB_IDS[IDX] == user_data); - REQUIRE(CB_IDS[IDX] == CB_IDS[calls_order[expected_callback]]); delays[IDX] = ns_late.count(); ++expected_callback; } |