mirror of
https://gitlab.com/suyu-emu/suyu.git
synced 2024-03-15 23:15:44 +00:00
fixup! hle: kernel: Add initial impl. of KAutoObjectWithListContainer.
This commit is contained in:
parent
51aa5a5364
commit
4356361faf
|
@ -28,16 +28,11 @@ public:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
class ListAccessor : public KScopedLightLock {
|
class ListAccessor : public KScopedLightLock {
|
||||||
private:
|
|
||||||
ListType& m_list;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit ListAccessor(KAutoObjectWithListContainer* container)
|
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)
|
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 {
|
typename ListType::iterator begin() const {
|
||||||
return m_list.begin();
|
return m_list.begin();
|
||||||
|
@ -50,14 +45,13 @@ public:
|
||||||
typename ListType::iterator find(typename ListType::const_reference ref) const {
|
typename ListType::iterator find(typename ListType::const_reference ref) const {
|
||||||
return m_list.find(ref);
|
return m_list.find(ref);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
ListType& m_list;
|
||||||
};
|
};
|
||||||
|
|
||||||
friend class ListAccessor;
|
friend class ListAccessor;
|
||||||
|
|
||||||
private:
|
|
||||||
KLightLock m_lock;
|
|
||||||
ListType m_object_list;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
KAutoObjectWithListContainer(KernelCore& kernel) : m_lock(kernel), m_object_list() {}
|
KAutoObjectWithListContainer(KernelCore& kernel) : m_lock(kernel), m_object_list() {}
|
||||||
|
|
||||||
|
@ -67,6 +61,10 @@ public:
|
||||||
void Register(KAutoObjectWithList* obj);
|
void Register(KAutoObjectWithList* obj);
|
||||||
void Unregister(KAutoObjectWithList* obj);
|
void Unregister(KAutoObjectWithList* obj);
|
||||||
size_t GetOwnedCount(KProcess* owner);
|
size_t GetOwnedCount(KProcess* owner);
|
||||||
|
|
||||||
|
private:
|
||||||
|
KLightLock m_lock;
|
||||||
|
ListType m_object_list;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Kernel
|
} // namespace Kernel
|
||||||
|
|
Loading…
Reference in a new issue