Function

DexCoroutineFunc

Declaration

DexFuture*
(* DexCoroutineFunc) (
  DexCoroutineContext* context,
  gpointer user_data
)

Description [src]

This function prototype is used for spawning stackless coroutines.

A coroutine function receives a DexCoroutineContext and optional user data and returns the next future for completion.

If the function returns NULL to indicate suspension, it must have stashed the currently awaited future in coroutine using the DEX_COROUTINE_SUSPEND_* helpers.

Parameters

context

Type: DexCoroutineContext

No description available.

The data is owned by the caller of the function.
user_data

Type: gpointer

No description available.

The argument can be NULL.
The data is owned by the caller of the function.

Return value

Type: DexFuture

A DexFuture.

The caller of the function takes ownership of the data, and is responsible for freeing it.
The return value can be NULL.