zephyr::raw

Function k_thread_suspend

source
pub unsafe extern "C" fn k_thread_suspend(thread: *mut k_thread)
Expand description

@brief Suspend a thread.

This routine prevents the kernel scheduler from making @a thread the current thread. All other internal operations on @a thread are still performed; for example, kernel objects it is waiting on are still handed to it. Note that any existing timeouts (e.g. k_sleep(), or a timeout argument to k_sem_take() et. al.) will be canceled. On resume, the thread will begin running immediately and return from the blocked call.

When the target thread is active on another CPU, the caller will block until the target thread is halted (suspended or aborted). But if the caller is in an interrupt context, it will spin waiting for that target thread active on another CPU to halt.

If @a thread is already suspended, the routine has no effect.

@param thread ID of thread to suspend.