Function rust_hawktracer::ht_task_scheduler_schedule_task[][src]

pub unsafe extern "C" fn ht_task_scheduler_schedule_task(
    task_scheduler: *mut HT_TaskScheduler,
    mode: HT_TaskSchedulingMode,
    period: HT_DurationNs,
    callback: HT_TaskCallback,
    user_data: *mut c_void
) -> HT_TaskId

Adds a new task to a scheduler. @param task_scheduler a pointer to the scheduler. @param mode a task scheduling mode. @sa HT_TaskSchedulingMode @param period a minimum time (in nanoseconds) between two executions of the task. @param callback a task's function. Can not be NULL. @param user_data a pointer to a data which is passed to a callback when executed.

@return a unique identifier of the task if the task is scheduled successfully; otherwise #HT_TASK_SCHEDULER_INVALID_TASK_ID.