Function riot_sys::msg_send

source ·
pub unsafe extern "C" fn msg_send(
    m: *mut msg_t,
    target_pid: kernel_pid_t
) -> c_int
Expand description

@brief Send a message (blocking).

This function sends a message to another thread. The msg_t structure has to be allocated (e.g. on the stack) before calling the function and can be freed afterwards. If called from an interrupt, this function will never block.

@param[in] m Pointer to preallocated msg_t structure, must not be NULL. @param[in] target_pid PID of target thread

@return 1, if sending was successful (message delivered directly or to a queue) @return 0, if called from ISR and receiver cannot receive the message now (it is not waiting or it’s message queue is full) @return -1, on error (invalid PID)