summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2022-07-02 15:45:38 +0200
committerFernando Sahmkow <fsahmkow27@gmail.com>2022-07-02 23:02:16 +0200
commitd3cb9201f1d34dd804a90cfe1f17142e5f4fa3b7 (patch)
tree6b3e171b3e60125686cd93ce8ddfa7bb2aada22f
parentMerge pull request #8523 from liamwhite/sc-oopsie (diff)
downloadyuzu-d3cb9201f1d34dd804a90cfe1f17142e5f4fa3b7.tar
yuzu-d3cb9201f1d34dd804a90cfe1f17142e5f4fa3b7.tar.gz
yuzu-d3cb9201f1d34dd804a90cfe1f17142e5f4fa3b7.tar.bz2
yuzu-d3cb9201f1d34dd804a90cfe1f17142e5f4fa3b7.tar.lz
yuzu-d3cb9201f1d34dd804a90cfe1f17142e5f4fa3b7.tar.xz
yuzu-d3cb9201f1d34dd804a90cfe1f17142e5f4fa3b7.tar.zst
yuzu-d3cb9201f1d34dd804a90cfe1f17142e5f4fa3b7.zip
-rw-r--r--src/core/core_timing.cpp12
-rw-r--r--src/core/core_timing.h2
2 files changed, 2 insertions, 12 deletions
diff --git a/src/core/core_timing.cpp b/src/core/core_timing.cpp
index 140578069..07b8e356b 100644
--- a/src/core/core_timing.cpp
+++ b/src/core/core_timing.cpp
@@ -61,12 +61,7 @@ void CoreTiming::Initialize(std::function<void()>&& on_thread_init_) {
const auto empty_timed_callback = [](std::uintptr_t, std::chrono::nanoseconds) {};
ev_lost = CreateEvent("_lost_event", empty_timed_callback);
if (is_multicore) {
- const auto hardware_concurrency = std::thread::hardware_concurrency();
- size_t id = 0;
- worker_threads.emplace_back(ThreadEntry, std::ref(*this), id++);
- if (hardware_concurrency > 8) {
- worker_threads.emplace_back(ThreadEntry, std::ref(*this), id++);
- }
+ worker_threads.emplace_back(ThreadEntry, std::ref(*this), 0);
}
}
@@ -228,14 +223,11 @@ std::optional<s64> CoreTiming::Advance() {
event_queue.pop_back();
if (const auto event_type{evt.type.lock()}) {
- sequence_mutex.lock();
+
event_mutex.unlock();
- event_type->guard.lock();
- sequence_mutex.unlock();
const s64 delay = static_cast<s64>(GetGlobalTimeNs().count() - evt.time);
event_type->callback(evt.user_data, std::chrono::nanoseconds{delay});
- event_type->guard.unlock();
event_mutex.lock();
pending_events.fetch_sub(1, std::memory_order_relaxed);
diff --git a/src/core/core_timing.h b/src/core/core_timing.h
index a86553e08..c52bffb3b 100644
--- a/src/core/core_timing.h
+++ b/src/core/core_timing.h
@@ -32,7 +32,6 @@ struct EventType {
TimedCallback callback;
/// A pointer to the name of the event.
const std::string name;
- mutable std::mutex guard;
};
/**
@@ -157,7 +156,6 @@ private:
std::condition_variable wait_pause_cv;
std::condition_variable wait_signal_cv;
mutable std::mutex event_mutex;
- mutable std::mutex sequence_mutex;
std::atomic<bool> paused_state{};
bool is_paused{};