User manual

131
where
task_body -
pointer on thread main function.
task_arg -
pointer on arguments of thread`s main function.
Create and execute new task. Returns
chapi_invalid_handle
if create task failed.
chapi_proc_t chapi_task::wait_for_result(chapi_handle_t the_task);
where
the_task -
Task hendler.
This method waits for the task to complete, and returns the task's completion status.
template <class T>chapi_task_starter
where
T
- class containing thread main method.
class is task utility provide starat new thread use as main functio a class method. For run
task need use follow method:
static chapi_handle_t run_task(T * instance,
chapi_proc_t (T::* task_body)(void * task_arg),
void * task_arg = 0);
where
instance
- pointer on instance of a class
task_body
- pointer on start member method of class
task_arg
- pointer on arguments of start method
CHAPI common containers
template<class Elem, udword_t max_buffer_size> class chapi_ring_buffer
where
Elem
-buffer element type