Function
Dexthread_spawn
since: 1.0
Declaration [src]
DexFuture*
dex_thread_spawn (
const char* thread_name,
DexThreadFunc thread_func,
gpointer user_data,
GDestroyNotify user_data_destroy
)
Description [src]
Spawns a new thread named thread_name running thread_func with
user_data passed to it.
thread_func must return a DexFuture. Callback data remains alive
until that future completes, even if the returned thread future is dropped.
Destruction is queued on the captured scheduler and may run after completion.
If this function is called from a thread that is not running a
DexScheduler then the default scheduler will be used
to call user_data_destroy.
If the resulting DexFuture has not resolved or rejected,
then the same scheduler used to call user_data_destroy will be
used to propagate the result to the caller.
Available since: 1.0
Parameters
thread_name-
Type:
const char*The name for the thread.
The argument can be NULL.The data is owned by the caller of the function. The value is a NUL terminated UTF-8 string. thread_func-
Type:
DexThreadFuncThe function to call on a thread.
user_data-
Type:
gpointerClosure data for
thread_func.The argument can be NULL.The data is owned by the caller of the function. user_data_destroy-
Type:
GDestroyNotifyCallback to free
user_datawhich will be called on the same thread calling this function.