diff options
| author | lizzie <lizzie@eden-emu.dev> | 2026-09-16 15:35:13 +0200 |
|---|---|---|
| committer | crueter <crueter@eden-emu.dev> | 2026-09-16 15:35:13 +0200 |
| commit | ac35358b3ffed74aaac56b0e99b09e81bb60d2e1 (patch) | |
| tree | 1bb14ab1d393d42b592ebdef86614aa68b01aefa /src/core/hle/kernel | |
| parent | 7bf95be2c29328a4cfeb8b2384ce34c6fb6d890c (diff) | |
[common] Replace `Common::SpinLock` with `std::mutex` (#4436)
`std::mutex` can be better than the spin-lock specially since we don't waste CPU cycles for no reason.
Test less stuttering/heat consumption.
Signed-off-by: lizzie <lizzie@eden-emu.dev>
- [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions).
- [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md)
- [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability.
-------------------
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4436
Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
Reviewed-by: MaranBr <maranbr@eden-emu.dev>
Diffstat (limited to 'src/core/hle/kernel')
| -rw-r--r-- | src/core/hle/kernel/k_slab_heap.h | 7 | ||||
| -rw-r--r-- | src/core/hle/kernel/k_thread.h | 3 |
2 files changed, 4 insertions, 6 deletions
diff --git a/src/core/hle/kernel/k_slab_heap.h b/src/core/hle/kernel/k_slab_heap.h index c91e7969a2..a5dbab9571 100644 --- a/src/core/hle/kernel/k_slab_heap.h +++ b/src/core/hle/kernel/k_slab_heap.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project @@ -12,7 +12,6 @@ #include "common/atomic_ops.h" #include "common/common_funcs.h" #include "common/common_types.h" -#include "common/spin_lock.h" namespace Kernel { @@ -30,7 +29,7 @@ public: }; public: - constexpr KSlabHeapImpl() = default; + KSlabHeapImpl() = default; void Initialize() { ASSERT(m_head == nullptr); @@ -68,7 +67,7 @@ public: private: std::atomic<Node*> m_head{}; - Common::SpinLock m_lock; + std::mutex m_lock; }; } // namespace impl diff --git a/src/core/hle/kernel/k_thread.h b/src/core/hle/kernel/k_thread.h index 95ba1b4d76..0ee5f72c8e 100644 --- a/src/core/hle/kernel/k_thread.h +++ b/src/core/hle/kernel/k_thread.h @@ -19,7 +19,6 @@ #include "common/intrusive_red_black_tree.h" #include "common/scratch_buffer.h" -#include "common/spin_lock.h" #include "core/arm/arm_interface.h" #include "core/hle/kernel/k_affinity_mask.h" #include "core/hle/kernel/k_light_lock.h" @@ -920,7 +919,7 @@ private: bool m_resource_limit_release_hint{}; bool m_is_kernel_address_key{}; StackParameters m_stack_parameters{}; - Common::SpinLock m_context_guard{}; + std::mutex m_context_guard{}; // For emulation std::shared_ptr<Common::Fiber> m_host_context{}; |
