Zen API
 All Classes Files Functions Variables Typedefs Friends Macros Modules Pages
kStatus kThreadPool_BeginExecute ( kThreadPool  pool,
kThreadFx  entryFx,
kPointer  context,
kThreadPoolTransaction transaction 
)

Schedules the specified callback for execution on the thread pool.

The transaction argument can optionally receive a transaction handle that can be used to wait for callback completion. If the transaction argument is not kNULL, kThreadPool_EndExecute must be used to wait for transaction completion; otherwise, leaks will result.

This method is thread-safe.

Parameters
poolThread pool object.
entryFxFunction to execute.
contextContext parameter for callback function.
transactionOptionally receives a transaction handle; if received, must be passed to kThreadPool_EndExecute.
Returns
Operation status.