zephyr::raw

Function k_thread_foreach

source
pub unsafe extern "C" fn k_thread_foreach(
    user_cb: Option<unsafe extern "C" fn(_: *const k_thread, _: *mut c_void)>,
    user_data: *mut c_void,
)
Expand description

@brief Iterate over all the threads in the system.

This routine iterates over all the threads in the system and calls the user_cb function for each thread.

@param user_cb Pointer to the user callback function. @param user_data Pointer to user data.

@note @kconfig{CONFIG_THREAD_MONITOR} must be set for this function to be effective. @note This API uses @ref k_spin_lock to protect the _kernel.threads list which means creation of new threads and terminations of existing threads are blocked until this API returns.