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 to rtapi_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:

  1. 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 πŸ‘‘)
  2. It calls a blocking function, like rtapi_sem_take. It will resume when the function unblocks. (nap break πŸ›Œ)
  3. It is returned to the "paused" state by rtapi_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 πŸŽ€βœ¨πŸ¦‹