summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2020-07-12 21:27:24 -0300
committerReinUsesLisp <reinuseslisp@airmail.cc>2020-07-12 21:27:24 -0300
commit9b38f4fc55607a92f7e4fee81a2c25c326f602f1 (patch)
tree3f5486ca7f48efbba00fe4b2bd1c0e5d2aee8964 /src
parentf1d8c83e1c3972a3500bc912b2217e81ddc08e13 (diff)
kernel/scheduler: Use std::mutex instead of spin lock
Profiling shows that this is a highly contested mutex, causing dimishing results compared to a OS lock. std::mutex implementations can spin for a while before falling back to an OS lock. This avoids wasting precious CPU cycles in a no-op.
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/kernel/scheduler.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/hle/kernel/scheduler.h b/src/core/hle/kernel/scheduler.h
index b3b4b5169..b9cad3f4a 100644
--- a/src/core/hle/kernel/scheduler.h
+++ b/src/core/hle/kernel/scheduler.h
@@ -188,7 +188,7 @@ private:
/// Scheduler lock mechanisms.
bool is_locked{};
- Common::SpinLock inner_lock{};
+ std::mutex inner_lock;
std::atomic<s64> scope_lock{};
Core::EmuThreadHandle current_owner{Core::EmuThreadHandle::InvalidHandle()};