Kernel: Add a little explainer comment to ListedRefCounted

This commit is contained in:
Andreas Kling 2021-08-17 01:08:51 +02:00
parent ea09294351
commit 45a5cf95f9
Notes: sideshowbarker 2024-07-18 05:35:34 +09:00

View File

@ -10,6 +10,11 @@
namespace Kernel {
// ListedRefCounted<T> is a slot-in replacement for RefCounted<T> to use in classes
// that add themselves to a SpinLockProtectedValue<IntrusiveList> when constructed.
// The custom unref() implementation here ensures that the the list is locked during
// unref(), and that the T is removed from the list before ~T() is invoked.
template<typename T>
class ListedRefCounted : public RefCountedBase {
public: