OsThreadApi

Struct OsThreadApi 

Source
#[repr(C)]
pub struct OsThreadApi {
Show 23 fields pub create_critical_section: Option<unsafe extern "C" fn(cs: *mut CriticalSectionO)>, pub enter_critical_section: Option<unsafe extern "C" fn(cs: *mut CriticalSectionO)>, pub leave_critical_section: Option<unsafe extern "C" fn(cs: *mut CriticalSectionO)>, pub destroy_critical_section: Option<unsafe extern "C" fn(cs: *mut CriticalSectionO)>, pub create_semaphore: Option<unsafe extern "C" fn(initial_count: u32) -> SemaphoreO>, pub semaphore_add: Option<unsafe extern "C" fn(sem: SemaphoreO, count: u32)>, pub semaphore_wait: Option<unsafe extern "C" fn(sem: SemaphoreO)>, pub semaphore_poll: Option<unsafe extern "C" fn(sem: SemaphoreO) -> bool>, pub destroy_semaphore: Option<unsafe extern "C" fn(sem: SemaphoreO)>, pub thread_id: Option<unsafe extern "C" fn() -> u32>, pub processor_id: Option<unsafe extern "C" fn() -> u32>, pub create_thread: Option<unsafe extern "C" fn(entry: ThreadEntryF, user_data: *mut c_void, stack_size: u32, debug_name: *const c_char) -> ThreadO>, pub set_thread_priority: Option<unsafe extern "C" fn(thread: ThreadO, priority: OsThreadPriority)>, pub wait_for_thread: Option<unsafe extern "C" fn(thread: ThreadO)>, pub thread_id_from_tm_thread: Option<unsafe extern "C" fn(thread: ThreadO) -> u32>, pub convert_thread_to_fiber: Option<unsafe extern "C" fn(user_data: *mut c_void) -> FiberO>, pub convert_fiber_to_thread: Option<unsafe extern "C" fn()>, pub create_fiber: Option<unsafe extern "C" fn(entry: FiberEntryF, user_data: *mut c_void, stack_size: u32) -> FiberO>, pub destroy_fiber: Option<unsafe extern "C" fn(fiber: FiberO)>, pub switch_to_fiber: Option<unsafe extern "C" fn(fiber: FiberO)>, pub fiber_user_data: Option<unsafe extern "C" fn() -> *mut c_void>, pub yield_processor: Option<unsafe extern "C" fn()>, pub sleep: Option<unsafe extern "C" fn(seconds: f64)>,
}

Fields§

§create_critical_section: Option<unsafe extern "C" fn(cs: *mut CriticalSectionO)>§enter_critical_section: Option<unsafe extern "C" fn(cs: *mut CriticalSectionO)>§leave_critical_section: Option<unsafe extern "C" fn(cs: *mut CriticalSectionO)>§destroy_critical_section: Option<unsafe extern "C" fn(cs: *mut CriticalSectionO)>§create_semaphore: Option<unsafe extern "C" fn(initial_count: u32) -> SemaphoreO>§semaphore_add: Option<unsafe extern "C" fn(sem: SemaphoreO, count: u32)>§semaphore_wait: Option<unsafe extern "C" fn(sem: SemaphoreO)>§semaphore_poll: Option<unsafe extern "C" fn(sem: SemaphoreO) -> bool>§destroy_semaphore: Option<unsafe extern "C" fn(sem: SemaphoreO)>§thread_id: Option<unsafe extern "C" fn() -> u32>§processor_id: Option<unsafe extern "C" fn() -> u32>§create_thread: Option<unsafe extern "C" fn(entry: ThreadEntryF, user_data: *mut c_void, stack_size: u32, debug_name: *const c_char) -> ThreadO>§set_thread_priority: Option<unsafe extern "C" fn(thread: ThreadO, priority: OsThreadPriority)>§wait_for_thread: Option<unsafe extern "C" fn(thread: ThreadO)>§thread_id_from_tm_thread: Option<unsafe extern "C" fn(thread: ThreadO) -> u32>§convert_thread_to_fiber: Option<unsafe extern "C" fn(user_data: *mut c_void) -> FiberO>§convert_fiber_to_thread: Option<unsafe extern "C" fn()>§create_fiber: Option<unsafe extern "C" fn(entry: FiberEntryF, user_data: *mut c_void, stack_size: u32) -> FiberO>§destroy_fiber: Option<unsafe extern "C" fn(fiber: FiberO)>§switch_to_fiber: Option<unsafe extern "C" fn(fiber: FiberO)>§fiber_user_data: Option<unsafe extern "C" fn() -> *mut c_void>§yield_processor: Option<unsafe extern "C" fn()>§sleep: Option<unsafe extern "C" fn(seconds: f64)>

Implementations§

Source§

impl OsThreadApi

Source

pub unsafe fn create_critical_section(&self, cs: *mut CriticalSectionO)

Source

pub unsafe fn enter_critical_section(&self, cs: *mut CriticalSectionO)

Source

pub unsafe fn leave_critical_section(&self, cs: *mut CriticalSectionO)

Source

pub unsafe fn destroy_critical_section(&self, cs: *mut CriticalSectionO)

Source

pub unsafe fn create_semaphore(&self, initial_count: u32) -> SemaphoreO

Source

pub unsafe fn semaphore_add(&self, sem: SemaphoreO, count: u32)

Source

pub unsafe fn semaphore_wait(&self, sem: SemaphoreO)

Source

pub unsafe fn semaphore_poll(&self, sem: SemaphoreO) -> bool

Source

pub unsafe fn destroy_semaphore(&self, sem: SemaphoreO)

Source

pub unsafe fn thread_id(&self) -> u32

Source

pub unsafe fn processor_id(&self) -> u32

Source

pub unsafe fn create_thread( &self, entry: ThreadEntryF, user_data: *mut c_void, stack_size: u32, debug_name: *const c_char, ) -> ThreadO

Source

pub unsafe fn set_thread_priority( &self, thread: ThreadO, priority: OsThreadPriority, )

Source

pub unsafe fn wait_for_thread(&self, thread: ThreadO)

Source

pub unsafe fn thread_id_from_tm_thread(&self, thread: ThreadO) -> u32

Source

pub unsafe fn convert_thread_to_fiber(&self, user_data: *mut c_void) -> FiberO

Source

pub unsafe fn convert_fiber_to_thread(&self)

Source

pub unsafe fn create_fiber( &self, entry: FiberEntryF, user_data: *mut c_void, stack_size: u32, ) -> FiberO

Source

pub unsafe fn destroy_fiber(&self, fiber: FiberO)

Source

pub unsafe fn switch_to_fiber(&self, fiber: FiberO)

Source

pub unsafe fn fiber_user_data(&self) -> *mut c_void

Source

pub unsafe fn yield_processor(&self)

Source

pub unsafe fn sleep(&self, seconds: f64)

Trait Implementations§

Source§

impl Clone for OsThreadApi

Source§

fn clone(&self) -> OsThreadApi

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for OsThreadApi

Source§

fn default() -> OsThreadApi

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

impl Copy for OsThreadApi

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.