rtapi_task_pause(3rtapi)
rtapi_task_pause π rtapi_task_resume β pausing & resuming your real-time tasks
okay bestie, welcome to the 3rtapi girlies club β¨ this one is literally about pressing βΈοΈ and βΆοΈ on real-time tasks, and it's giving very much "pause, periodt, resume" energy. no cap.
πΈ SYNTAX πΈ
void rtapi_task_pause(int task_id)
void rtapi_task_resume(int task_id)
that's it. two little void functions. iconic. π
π ARGUMENTS π
task_idβ an RTAPI task identifier that came back from an earlier call tortapi_task_new. so like, you gotta have made the task first, bestie, we're not manifesting task IDs out of thin air π¦
β¨ DESCRIPTION β¨
so rtapi_task_resume starts a task in free-running mode. and the task must be in the "paused" state already, okay? like it has to be sitting there paused, waiting for you. the vibe check is non-negotiable.
a free running task runs continuously until either:
- It is preempted by a higher priority task. It will resume as soon as the higher priority task releases the CPU. (main character task energy, it just gets the CPU back when the VIP is done π)
- It calls a blocking function, like
rtapi_sem_take. It will resume when the function unblocks. (nap break π) - It is returned to the
"paused"state byrtapi_task_pause. May be called from init/cleanup code, and from within realtime tasks.
rtapi_task_pause causes a task to stop execution and change to the "paused" state. the task can be free-running or periodic, either one, no judgement π
not me about to say the important bit: rtapi_task_pause may be called from any task, or from init or cleanup code, not just from the task that is to be paused. yes bestie, you can pause your friend. it's fine. it's allowed. π
the task will resume execution when either rtapi_task_resume or rtapi_task_start is called β and which one you use depends on whether this is a free-running or a periodic task. pick the right one, i'm begging π
π§ REALTIME CONSIDERATIONS π§
May be called from init/cleanup code, and from within realtime tasks. yes queen, both places, she's flexible like that π
π« RETURN VALUE π«
An RTAPI status code. so like, go check it, don't just vibe and ignore it fr fr β
π₯ SEE ALSO π₯
that's the whole page, bestie, you ate it π this slice of RTAPI lore is brought to you by LinuxCNC Documentation, dated 2006-10-12 β yeah it's an elder but she's still slaying, no cap πβ¨π¦
π¦ where this page comes from
- debian bookworm: linuxcnc-uspace-dev 2.9.0~pre1+git20230208.f1270d6ed7-1+deb12u2 Β· GFDL-1.1-or-later
- debian trixie: linuxcnc-uspace-dev 1:2.9.4-2+deb13u1 Β· GFDL-1.1-or-later
- ubuntu questing: linuxcnc-uspace-dev 1:2.9.4-2ubuntu2
- ubuntu resolute: linuxcnc-uspace-dev 1:2.9.4-2ubuntu4 Β· GFDL-1.1-or-later
- ubuntu stonking: linuxcnc-uspace-dev 1:2.9.4-2ubuntu4 Β· GFDL-1.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms