Skip to main content

k_thread

Struct k_thread 

Source
#[repr(C)]
pub struct k_thread { pub base: _thread_base, pub callee_saved: _callee_saved, pub init_data: *mut c_void, pub join_queue: _wait_q_t, pub poller: z_poller, pub resource_pool: *mut k_heap, pub tls: usize, pub held_mutexes: _slist, pub mutex_pended_on: *mut k_mutex, pub orig_prio: i8, pub arch: _thread_arch, }
Expand description

@ingroup thread_apis Thread Structure

Fields§

§base: _thread_base§callee_saved: _callee_saved

defined by the architecture, but all archs need these

§init_data: *mut c_void

static thread init data

§join_queue: _wait_q_t

threads waiting in k_thread_join()

§poller: z_poller§resource_pool: *mut k_heap

resource pool

§tls: usize§held_mutexes: _slist

List of all mutexes currently held by this thread. Used to recalculate the thread’s priority when a mutex is released, and to propagate priority boosts through the ownership chain.

§mutex_pended_on: *mut k_mutex

Mutex this thread is currently blocked on, or NULL if not blocked. Used for chained priority inheritance (to boost the owner of the mutex this thread is waiting for) and for deadlock cycle detection.

§orig_prio: i8

Thread’s priority before any mutex inheritance boost.

§arch: _thread_arch

arch-specifics: must always be at the end

Trait Implementations§

Source§

impl Default for k_thread

Source§

fn default() -> k_thread

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.