zephyr::raw

Function k_thread_join

source
pub unsafe extern "C" fn k_thread_join(
    thread: *mut k_thread,
    timeout: k_timeout_t,
) -> i32
Expand description

@brief Sleep until a thread exits

The caller will be put to sleep until the target thread exits, either due to being aborted, self-exiting, or taking a fatal error. This API returns immediately if the thread isn’t running.

This API may only be called from ISRs with a K_NO_WAIT timeout, where it can be useful as a predicate to detect when a thread has aborted.

@param thread Thread to wait to exit @param timeout upper bound time to wait for the thread to exit. @retval 0 success, target thread has exited or wasn’t running @retval -EBUSY returned without waiting @retval -EAGAIN waiting period timed out @retval -EDEADLK target thread is joining on the caller, or target thread is the caller