class Completion

Defined at line 22 of file ../../zircon/system/ulib/sync/include/lib/sync/cpp/completion.h

C++ wrapper for a completion object, |sync_completion_t|. A |Completion| is

a synchronization primitive that allows for one or more threads to wait for

a signal from another thread.

See

<lib

/sync/completion.h> for full details.

This class is thread-safe.

Public Methods

void Wait ()

Waits until woken by a call to |Signal| or if the completion has

already been signaled.

Defined at line 26 of file ../../zircon/system/ulib/sync/include/lib/sync/cpp/completion.h

zx_status_t Wait (zx::duration timeout)

Returns ZX_ERR_TIMED_OUT if |timeout| elapses, and ZX_OK if woken by a

call to |Signal| or if the completion has already been signaled.

Defined at line 34 of file ../../zircon/system/ulib/sync/include/lib/sync/cpp/completion.h

zx_status_t Wait (zx::time deadline)

Returns ZX_ERR_TIMED_OUT if |deadline| elapses, and ZX_OK if woken by a

call to |Signal| or if the completion has already been signaled.

Defined at line 40 of file ../../zircon/system/ulib/sync/include/lib/sync/cpp/completion.h

void Signal ()

Awakens all waiters on the completion, and marks it as signaled. Waits

after this call but before a reset of the completion will also see the

signal and immediately return.

Defined at line 47 of file ../../zircon/system/ulib/sync/include/lib/sync/cpp/completion.h

void Reset ()

Resets the completion object's signaled state to unsignaled.

Defined at line 50 of file ../../zircon/system/ulib/sync/include/lib/sync/cpp/completion.h

bool signaled ()

Returns true iff the completion object has been signaled.

Defined at line 53 of file ../../zircon/system/ulib/sync/include/lib/sync/cpp/completion.h

sync_completion_t * get ()

Gets the underlying |sync_completion_t|.

Defined at line 56 of file ../../zircon/system/ulib/sync/include/lib/sync/cpp/completion.h

const sync_completion_t * get ()

Gets the underlying |sync_completion_t|.

Defined at line 59 of file ../../zircon/system/ulib/sync/include/lib/sync/cpp/completion.h