1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 07:27:45 +00:00

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

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: