rtapi_task_new(3rtapi)

rtapi_task_new3rtapi

Create a realtime task

Usage

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

int rtapi_task_delete(int task_id)

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_xxxx

uses_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

Overview

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.

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.

Releases

Unchanged in 2 releases since Debian 12 (Bookworm).

  1. 12–13

From linuxcnc-uspace-dev 1:2.9.4-2+deb13u1 in Debian 13 (Trixie). Parsed by carta from the page's man source.