diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/kernel/k_auto_object_container.h | 20 |
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: | |||
| 28 | 28 | ||
| 29 | public: | 29 | public: |
| 30 | class ListAccessor : public KScopedLightLock { | 30 | class ListAccessor : public KScopedLightLock { |
| 31 | private: | ||
| 32 | ListType& m_list; | ||
| 33 | |||
| 34 | public: | 31 | public: |
| 35 | explicit ListAccessor(KAutoObjectWithListContainer* container) | 32 | explicit ListAccessor(KAutoObjectWithListContainer* container) |
| 36 | : KScopedLightLock(container->m_lock), m_list(container->m_object_list) { /* ... */ | 33 | : KScopedLightLock(container->m_lock), m_list(container->m_object_list) {} |
| 37 | } | ||
| 38 | explicit ListAccessor(KAutoObjectWithListContainer& container) | 34 | explicit ListAccessor(KAutoObjectWithListContainer& container) |
| 39 | : KScopedLightLock(container.m_lock), m_list(container.m_object_list) { /* ... */ | 35 | : KScopedLightLock(container.m_lock), m_list(container.m_object_list) {} |
| 40 | } | ||
| 41 | 36 | ||
| 42 | typename ListType::iterator begin() const { | 37 | typename ListType::iterator begin() const { |
| 43 | return m_list.begin(); | 38 | return m_list.begin(); |
| @@ -50,14 +45,13 @@ public: | |||
| 50 | typename ListType::iterator find(typename ListType::const_reference ref) const { | 45 | typename ListType::iterator find(typename ListType::const_reference ref) const { |
| 51 | return m_list.find(ref); | 46 | return m_list.find(ref); |
| 52 | } | 47 | } |
| 48 | |||
| 49 | private: | ||
| 50 | ListType& m_list; | ||
| 53 | }; | 51 | }; |
| 54 | 52 | ||
| 55 | friend class ListAccessor; | 53 | friend class ListAccessor; |
| 56 | 54 | ||
| 57 | private: | ||
| 58 | KLightLock m_lock; | ||
| 59 | ListType m_object_list; | ||
| 60 | |||
| 61 | public: | 55 | public: |
| 62 | KAutoObjectWithListContainer(KernelCore& kernel) : m_lock(kernel), m_object_list() {} | 56 | KAutoObjectWithListContainer(KernelCore& kernel) : m_lock(kernel), m_object_list() {} |
| 63 | 57 | ||
| @@ -67,6 +61,10 @@ public: | |||
| 67 | void Register(KAutoObjectWithList* obj); | 61 | void Register(KAutoObjectWithList* obj); |
| 68 | void Unregister(KAutoObjectWithList* obj); | 62 | void Unregister(KAutoObjectWithList* obj); |
| 69 | size_t GetOwnedCount(KProcess* owner); | 63 | size_t GetOwnedCount(KProcess* owner); |
| 64 | |||
| 65 | private: | ||
| 66 | KLightLock m_lock; | ||
| 67 | ListType m_object_list; | ||
| 70 | }; | 68 | }; |
| 71 | 69 | ||
| 72 | } // namespace Kernel | 70 | } // namespace Kernel |