zephyr::raw

Function k_is_preempt_thread

source
pub unsafe extern "C" fn k_is_preempt_thread() -> i32
Expand description

@brief Determine if code is running in a preemptible thread.

This routine allows the caller to customize its actions, depending on whether it can be preempted by another thread. The routine returns a ‘true’ value if all of the following conditions are met:

  • The code is running in a thread, not at ISR.
  • The thread’s priority is in the preemptible range.
  • The thread has not locked the scheduler.

@funcprops \isr_ok

@return 0 if invoked by an ISR or by a cooperative thread. @return Non-zero if invoked by a preemptible thread.