summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2021-05-01 21:38:23 +0200
committerbunnei <bunneidev@gmail.com>2021-05-06 01:40:53 +0200
commit4356361faf9b3fb87d55535e2e8300a8a4134a1d (patch)
treee849c36bf5f714833f5ac248c60c7e1afb6978b8 /src
parentfixup! hle: kernel: Add initial impl. of KAutoObjectWithListContainer. (diff)
downloadyuzu-4356361faf9b3fb87d55535e2e8300a8a4134a1d.tar
yuzu-4356361faf9b3fb87d55535e2e8300a8a4134a1d.tar.gz
yuzu-4356361faf9b3fb87d55535e2e8300a8a4134a1d.tar.bz2
yuzu-4356361faf9b3fb87d55535e2e8300a8a4134a1d.tar.lz
yuzu-4356361faf9b3fb87d55535e2e8300a8a4134a1d.tar.xz
yuzu-4356361faf9b3fb87d55535e2e8300a8a4134a1d.tar.zst
yuzu-4356361faf9b3fb87d55535e2e8300a8a4134a1d.zip
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/kernel/k_auto_object_container.h20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/core/hle/kernel/k_auto_object_container.h b/src/core/hle/kernel/k_auto_object_container.h
index 8609f7a8d..ff40cf5a7 100644
--- a/src/core/hle/kernel/k_auto_object_container.h
+++ b/src/core/hle/kernel/k_auto_object_container.h
@@ -28,16 +28,11 @@ public:
public:
class ListAccessor : public KScopedLightLock {
- private:
- ListType& m_list;
-
public:
explicit ListAccessor(KAutoObjectWithListContainer* container)
- : KScopedLightLock(container->m_lock), m_list(container->m_object_list) { /* ... */
- }
+ : KScopedLightLock(container->m_lock), m_list(container->m_object_list) {}
explicit ListAccessor(KAutoObjectWithListContainer& container)
- : KScopedLightLock(container.m_lock), m_list(container.m_object_list) { /* ... */
- }
+ : KScopedLightLock(container.m_lock), m_list(container.m_object_list) {}
typename ListType::iterator begin() const {
return m_list.begin();
@@ -50,14 +45,13 @@ public:
typename ListType::iterator find(typename ListType::const_reference ref) const {
return m_list.find(ref);
}
+
+ private:
+ ListType& m_list;
};
friend class ListAccessor;
-private:
- KLightLock m_lock;
- ListType m_object_list;
-
public:
KAutoObjectWithListContainer(KernelCore& kernel) : m_lock(kernel), m_object_list() {}
@@ -67,6 +61,10 @@ public:
void Register(KAutoObjectWithList* obj);
void Unregister(KAutoObjectWithList* obj);
size_t GetOwnedCount(KProcess* owner);
+
+private:
+ KLightLock m_lock;
+ ListType m_object_list;
};
} // namespace Kernel