Method

DexSchedulerspawn

Declaration [src]

DexFuture*
dex_scheduler_spawn (
  DexScheduler* scheduler,
  gsize stack_size,
  DexFiberFunc func,
  gpointer func_data,
  GDestroyNotify func_data_destroy
)

Description [src]

Request scheduler to spawn a DexFiber.

The fiber will have its own stack and cooperatively schedules among other fibers sharing the scheduler.

If stack_size is 0, it will set to a sensible default. Otherwise, it is rounded up to the nearest page size.

Parameters

scheduler

Type: DexScheduler

A DexScheduler.

The argument can be NULL.
stack_size

Type: gsize

Stack size in bytes or 0.

func

Type: DexFiberFunc

A DexFiberFunc.

func_data

Type: gpointer

Closure data for func.

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

Type: GDestroyNotify

Closure notify for func_data.

Return value

Type: DexFuture

A DexFuture that will resolve or reject when func completes (or its resulting DexFuture completes).

The caller of the method takes ownership of the returned data, and is responsible for freeing it.