class Event

Defined at line 40 of file ../../zircon/kernel/include/kernel/event.h

Rules for Events and AutounsignalEvents:

- Events may be signaled from interrupt context *but* preemption must be

disabled.

- Events may not be waited upon from interrupt context.

- Standard Events:

- Wake up any waiting threads when signaled.

- Continue to do so (no threads will wait) until unsignaled.

- Stores a single result value when first signaled. This result is

returned to waiters and cleared when unsignaled.

- AutounsignalEvents:

- If one or more threads are waiting when signaled, one thread will

be woken up and return. The signaled state will not be set.

- If no threads are waiting when signaled, the AutounsignalEvent will remain

in the signaled state until a thread attempts to wait (at which

time it will unsignal atomicly and return immediately) or

AutounsignalEvent::Unsignal() is called.

- Stores a single result value when signaled until a thread is woken.

Public Methods

void Event (bool initial)

Defined at line 42 of file ../../zircon/kernel/include/kernel/event.h

void ~Event ()

Defined at line 44 of file ../../zircon/kernel/include/kernel/event.h

void Event (const Event & )

Defined at line 46 of file ../../zircon/kernel/include/kernel/event.h

Event & operator= (const Event & )

Defined at line 47 of file ../../zircon/kernel/include/kernel/event.h

zx_status_t Wait (const Deadline & deadline)

Returns:

ZX_OK - signaled

ZX_ERR_TIMED_OUT - time out expired

ZX_ERR_INTERNAL_INTR_KILLED - thread killed

ZX_ERR_INTERNAL_INTR_RETRY - thread is suspended

Or the |status| which the caller specified in Event::Signal(status)

Defined at line 59 of file ../../zircon/kernel/include/kernel/event.h

zx_status_t Wait (const Deadline & deadline, uint signal_mask)

Same as Wait() but gives a mask of signals to ignore. The signal_mask only applies to existing

signals, not future ones that might be signaled while waiting.

The caller must be interruptible.

Defined at line 64 of file ../../zircon/kernel/include/kernel/event.h

zx_status_t Wait ()

No deadline, non interruptible version of Wait().

Defined at line 69 of file ../../zircon/kernel/include/kernel/event.h

zx_status_t WaitDeadline (zx_instant_mono_t deadline, Interruptible interruptible)

Wait until a zx_instant_mono_t deadline.

Interruptible arg allows it to return early with ZX_ERR_INTERNAL_INTR_KILLED if thread

is signaled for kill or with ZX_ERR_INTERNAL_INTR_RETRY if the thread is suspended.

Defined at line 74 of file ../../zircon/kernel/include/kernel/event.h

void Signal (zx_status_t wait_result, OwnedWaitQueue * queue_to_own)

Signals an event.

All waiting threads are allowed to proceed until such time as Unsignal() is called.

|wait_result| is the value to return for Wait(), if the wait was successful.

|queue_to_own| is the OwnedWaitQueue that the first unblocked thread will take ownership of. If

this is not-null, then we will perform an assign-owner operation on the queue. If there is no

thread waiting, then no assign-owner operation will occur.

Defined at line 86 of file ../../zircon/kernel/include/kernel/event.h

zx_status_t Unsignal ()

Defined at line 90 of file ../../zircon/kernel/include/kernel/event.h

bool is_signaled ()

Defined at line 91 of file ../../zircon/kernel/include/kernel/event.h

Protected Methods

void Event (bool initial, Flags flags)

Only our AutounsignalEvent subclass can also access this, to keep the flags private.

Defined at line 100 of file ../../zircon/kernel/include/kernel/event.h

Enumerations

enum Flags : uint32_t
Name Value
NONE 0
AUTOUNSIGNAL 1

Defined at line 94 of file ../../zircon/kernel/include/kernel/event.h

Friends

class EventLayout