class PortDispatcher

Defined at line 163 of file ../../zircon/kernel/object/include/object/port_dispatcher.h

PortObserver lifetime and locking notes: the canonical description of the

PortDispatcher / PortObserver / Dispatcher pointer graph, cancelation

ordering, and lock hierarchy lives in the module documentation at the top of

port_dispatcher.rs.

Public Methods

zx_rights_t default_rights ()

Defined at line 165 of file ../../zircon/kernel/object/include/object/port_dispatcher.h

zx_obj_type_t get_type ()

Defined at line 170 of file ../../zircon/kernel/object/include/object/port_dispatcher.h

void on_zero_handles ()

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

bool is_waitable ()

Defined at line 174 of file ../../zircon/kernel/object/include/object/port_dispatcher.h

zx_koid_t get_related_koid ()

Defined at line 175 of file ../../zircon/kernel/object/include/object/port_dispatcher.h

zx_status_t user_signal_self (uint32_t clear_mask, uint32_t set_mask)

Defined at line 177 of file ../../zircon/kernel/object/include/object/port_dispatcher.h

zx_status_t user_signal_peer (uint32_t clear_mask, uint32_t set_mask)

Defined at line 180 of file ../../zircon/kernel/object/include/object/port_dispatcher.h

zx_status_t Queue (PortPacket * port_packet)

Queues a packet on the port.

Defined at line 185 of file ../../zircon/kernel/object/include/object/port_dispatcher.h

zx_status_t QueueAndRemoveObserver (PortPacket * port_packet, zx_signals_t observed, PortObserver * observer, OwnedWaitQueue * queue_to_own)

Queues a packet based on a signal observation and deregisters the observer from the port.

If |observer| is non-null, also removes it from the observer list.

Defined at line 191 of file ../../zircon/kernel/object/include/object/port_dispatcher.h

void MaybeReap (PortObserver * observer, PortPacket * port_packet)

This method determines the observer's fate. Upon return, one of the following will have

occurred:

1. The observer is destroyed.

2. The observer is linked to an alreadyed queued packet and will be destroyed when the packet

is destroyed (Queued or CancelQueued).

3. The observer is left for on_zero_handles to destroyed.

Defined at line 207 of file ../../zircon/kernel/object/include/object/port_dispatcher.h

zx::result<SignalObserver *> MakeObserver (uint32_t options, const Handle * handle, uint64_t key, zx_signals_t signals)

Creates an observer registered with this port.

Requires that a read lock is held on the handle table containing |handle|.

Defined at line 214 of file ../../zircon/kernel/object/include/object/port_dispatcher.h

zx_status_t Create (uint32_t options, KernelHandle<PortDispatcher> * handle, zx_rights_t * rights)

Defined at line 215 of file ../../zircon/kernel/object/port_dispatcher.cc

void ~PortDispatcher ()

Defined at line 212 of file ../../zircon/kernel/object/port_dispatcher.cc

bool CancelQueued (PortPacket * port_packet)

Removes |port_packet| from this port's queue. Returns false if the packet was

not in this queue. It is undefined to call this with a packet queued in another port.

Defined at line 229 of file ../../zircon/kernel/object/include/object/port_dispatcher.h

void InitializeCacheAllocators (uint32_t level)

Init hook that sets up the cache allocators used by this dispatcher.

Defined at line 230 of file ../../zircon/kernel/object/port_dispatcher.cc

zx_status_t CancelKey (uint64_t key)

Cancel all pending waits and packets registered with |key|.

Returns ZX_OK if any waits or packets were canceled and ZX_ERR_NOT_FOUND if

no matching waits or packets were found.

Defined at line 236 of file ../../zircon/kernel/object/include/object/port_dispatcher.h

bool DispatcherLockIsHeld ()

Returns true if the dispatcher lock |get_lock()| is currently held.

Defined at line 242 of file ../../zircon/kernel/object/include/object/port_dispatcher.h

Protected Methods

Lock<CriticalMutex> * get_lock ()

Defined at line 212 of file ../../zircon/kernel/object/port_dispatcher.cc

Friends

zx_status_t PortDispatcher (uint32_t optionsffi::Uninitialized<KernelHandle<PortDispatcher>> * handle_outffi::Uninitialized<zx_rights_t> * rights_out)