template <typename T>

class KernelHandle

Defined at line 145 of file ../../zircon/kernel/object/include/object/handle.h

A minimal wrapper around a Dispatcher which is owned by the kernel.

Intended usage when creating a new Dispatcher object is:

1. Create a KernelHandle on the stack (cannot fail)

2. Move the RefPtr

<Dispatcher

> into the KernelHandle (cannot fail)

3. When ready to give the handle to a process, upgrade the KernelHandle

to a full HandleOwner via Handle::Make() (can fail)

This sequence ensures that the Dispatcher's on_zero_handles() method is

called even if errors occur during or before HandleOwner creation, which

is necessary to break circular references for some Dispatcher types.

This class is thread-unsafe and must be externally synchronized if used

across multiple threads.

Public Methods

void KernelHandle<T> ()

Defined at line 147 of file ../../zircon/kernel/object/include/object/handle.h

void KernelHandle<T> (fbl::RefPtr<T> dispatcher)

|dispatcher|'s handle count must be 0.

Defined at line 150 of file ../../zircon/kernel/object/include/object/handle.h

void ~KernelHandle<T> ()

Defined at line 154 of file ../../zircon/kernel/object/include/object/handle.h

void KernelHandle<T> (const KernelHandle<T> & )

Movable but not copyable since we own the underlying Dispatcher.

Defined at line 157 of file ../../zircon/kernel/object/include/object/handle.h

KernelHandle<T> & operator= (const KernelHandle<T> & )

Defined at line 158 of file ../../zircon/kernel/object/include/object/handle.h

template <typename U>
void KernelHandle<T> (KernelHandle<U> && other)

Defined at line 161 of file ../../zircon/kernel/object/include/object/handle.h

template <typename U>
KernelHandle<T> & operator= (KernelHandle<U> && other)

Defined at line 164 of file ../../zircon/kernel/object/include/object/handle.h

void reset ()

Defined at line 169 of file ../../zircon/kernel/object/include/object/handle.h

template <typename U>
void reset (fbl::RefPtr<U> dispatcher)

Defined at line 172 of file ../../zircon/kernel/object/include/object/handle.h

const fbl::RefPtr<T> & dispatcher ()

Defined at line 179 of file ../../zircon/kernel/object/include/object/handle.h

fbl::RefPtr<T> release ()

Defined at line 181 of file ../../zircon/kernel/object/include/object/handle.h

Friends

template <typename U>
class KernelHandle