Skip to main content

async_check_sequence_id

Function async_check_sequence_id 

Source
pub unsafe extern "C" fn async_check_sequence_id(
    dispatcher: *mut async_dispatcher_t,
    sequence_id: async_sequence_id_t,
    out_error: *mut *const c_char,
) -> zx_status_t
Expand description

Checks that the the dispatcher-specific sequence identifier of the currently executing task is equal to |sequence_id|.

If the sequence identifier of the calling thread cannot be successfully obtained, it should return an error code detailed below:

  • Returns |ZX_ERR_INVALID_ARGS| if the dispatcher supports sequences, but the calling thread is not executing a task managed by the dispatcher.
  • Returns |ZX_ERR_WRONG_TYPE| if the calling thread is executing a task managed by the dispatcher, but that task is not part of a sequence.
  • Returns |ZX_ERR_NOT_SUPPORTED| if not supported by the dispatcher.

Otherwise, the dispatcher should check that the sequence identifier representing the current sequence equals to |sequence_id|:

  • Returns |ZX_OK| if the sequence identifiers are equal.
  • Returns |ZX_ERR_OUT_OF_RANGE| if the sequence identifiers are not equal.

|out_error| will not be mutated when the return value is |ZX_OK|. Otherwise, it will be set to a NULL-terminated detailed explanation of the error, which may suggest corrective actions that are specific to that asynchronous runtime. If set, the error string will have static storage duration (for example, an implementation may return string literals).

This operation is thread-safe.