logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

rtapi_task_new - create a realtime task

Arguments

taskcode
              A pointer to the function to be called when the task is started

       arg    An argument to be passed to the taskcode function when the task is started

       prio   A task priority value returned by rtapi_prio_xxxxuses_fp
              A flag that tells the OS whether the task uses floating point or not.

       task_id
              A task ID returned by a previous call to rtapi_task_new

Description

rtapi_task_new creates but does not start a realtime task.  The task is created in  the  "paused"  state.
       To  start  it,  call  either  rtapi_task_start  for periodic tasks, or rtapi_task_resume for free-running
       tasks.

Name

       rtapi_task_new - create a realtime task

Realtime Considerations

       Call only from within init/cleanup code, not from realtime tasks.

Return Value

       On success, returns a positive integer task ID.  This ID is used for all subsequent calls  that  need  to
       act on the task.  On failure, returns an RTAPI status code.

See Also

rtapi_prio(3rtapi), rtapi_task_start(3rtapi), rtapi_task_wait(3rtapi), rtapi_task_resume(3rtapi)

LinuxCNC Documentation                             2006-10-12                             rtapi_task_new(3rtapi)

Syntax


       int  rtapi_task_new(void  (*taskcode)(void*),  void  *arg,       int  prio,  unsigned long stacksize, int
              uses_fp)

       int rtapi_task_delete(int task_id)

See Also