[zircon] dispatcher inheritance cleanup
The Dispatcher class' base classes provide implementation
only facilities, it is never desirable to refer
a dispatcher object via a RefCounted or Recyclable pointer
and by making this private we communicate this intention
to the compiler.
Change-Id: Ia85059dd03c6a604453aff0d35ba4fc32b3bad15
diff --git a/kernel/object/include/object/dispatcher.h b/kernel/object/include/object/dispatcher.h
index 4a0dc13..13f5a1e 100644
--- a/kernel/object/include/object/dispatcher.h
+++ b/kernel/object/include/object/dispatcher.h
@@ -62,9 +62,27 @@
#undef DECLARE_DISPTAG
-class Dispatcher : public fbl::RefCounted<Dispatcher>,
- public fbl::Recyclable<Dispatcher> {
+// Base class for all kernel objects that can be exposed to user-mode via
+// the syscall API and referenced by handles.
+//
+// It implements RefCounted because handles are abstractions to a multiple
+// references from user mode or kernel mode that control the lifetime o
+// the object.
+//
+// It implements Recyclable because upon final Release() on the RefPtr
+// it might be necessary to implement a destruction pattern that avoids
+// deep recursion since the kernel stack is very limited.
+//
+// You rarely derive directly from this class; instead consider deriving
+// from SoloDispatcher or PeeredDispatcher.
+class Dispatcher : private fbl::RefCounted<Dispatcher>,
+ private fbl::Recyclable<Dispatcher> {
public:
+ using fbl::RefCounted<Dispatcher>::AddRef;
+ using fbl::RefCounted<Dispatcher>::Release;
+ using fbl::RefCounted<Dispatcher>::Adopt;
+ using fbl::RefCounted<Dispatcher>::AddRefMaybeInDestructor;
+
// At construction, the object's state tracker is asserting
// |signals|.
explicit Dispatcher(zx_signals_t signals = 0u);