Skip to content

Commit

Permalink
Kernel: Add a little explainer comment to ListedRefCounted
Browse files Browse the repository at this point in the history
  • Loading branch information
awesomekling committed Aug 16, 2021
1 parent ea09294 commit 45a5cf9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Kernel/Library/ListedRefCounted.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 45a5cf9

Please sign in to comment.