summaryrefslogtreecommitdiffstats
path: root/src/tests
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2021-11-28 12:21:45 +0100
committerFernando Sahmkow <fsahmkow27@gmail.com>2022-06-28 01:10:55 +0200
commit9cafb0d91266210dab2c72e484b493bceae1cb02 (patch)
treeb7a350271073804162c41254ff1889c8ec2a76bf /src/tests
parentCore: add missing include. (diff)
downloadyuzu-9cafb0d91266210dab2c72e484b493bceae1cb02.tar
yuzu-9cafb0d91266210dab2c72e484b493bceae1cb02.tar.gz
yuzu-9cafb0d91266210dab2c72e484b493bceae1cb02.tar.bz2
yuzu-9cafb0d91266210dab2c72e484b493bceae1cb02.tar.lz
yuzu-9cafb0d91266210dab2c72e484b493bceae1cb02.tar.xz
yuzu-9cafb0d91266210dab2c72e484b493bceae1cb02.tar.zst
yuzu-9cafb0d91266210dab2c72e484b493bceae1cb02.zip
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/core/core_timing.cpp3
1 files changed, 3 insertions, 0 deletions
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 @@
#include <chrono>
#include <cstdlib>
#include <memory>
+#include <mutex>
#include <string>
#include "core/core.h"
@@ -21,9 +22,11 @@ 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);