#[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
impl OsThreadApi
pub unsafe fn create_critical_section(&self, cs: *mut CriticalSectionO)
pub unsafe fn enter_critical_section(&self, cs: *mut CriticalSectionO)
pub unsafe fn leave_critical_section(&self, cs: *mut CriticalSectionO)
pub unsafe fn destroy_critical_section(&self, cs: *mut CriticalSectionO)
pub unsafe fn create_semaphore(&self, initial_count: u32) -> SemaphoreO
pub unsafe fn semaphore_add(&self, sem: SemaphoreO, count: u32)
pub unsafe fn semaphore_wait(&self, sem: SemaphoreO)
pub unsafe fn semaphore_poll(&self, sem: SemaphoreO) -> bool
pub unsafe fn destroy_semaphore(&self, sem: SemaphoreO)
pub unsafe fn thread_id(&self) -> u32
pub unsafe fn processor_id(&self) -> u32
pub unsafe fn create_thread( &self, entry: ThreadEntryF, user_data: *mut c_void, stack_size: u32, debug_name: *const c_char, ) -> ThreadO
pub unsafe fn set_thread_priority( &self, thread: ThreadO, priority: OsThreadPriority, )
pub unsafe fn wait_for_thread(&self, thread: ThreadO)
pub unsafe fn thread_id_from_tm_thread(&self, thread: ThreadO) -> u32
pub unsafe fn convert_thread_to_fiber(&self, user_data: *mut c_void) -> FiberO
pub unsafe fn convert_fiber_to_thread(&self)
pub unsafe fn create_fiber( &self, entry: FiberEntryF, user_data: *mut c_void, stack_size: u32, ) -> FiberO
pub unsafe fn destroy_fiber(&self, fiber: FiberO)
pub unsafe fn switch_to_fiber(&self, fiber: FiberO)
pub unsafe fn fiber_user_data(&self) -> *mut c_void
pub unsafe fn yield_processor(&self)
pub unsafe fn sleep(&self, seconds: f64)
Trait Implementations§
Source§impl Clone for OsThreadApi
impl Clone for OsThreadApi
Source§fn clone(&self) -> OsThreadApi
fn clone(&self) -> OsThreadApi
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Default for OsThreadApi
impl Default for OsThreadApi
Source§fn default() -> OsThreadApi
fn default() -> OsThreadApi
Returns the “default value” for a type. Read more
impl Copy for OsThreadApi
Auto Trait Implementations§
impl Freeze for OsThreadApi
impl RefUnwindSafe for OsThreadApi
impl Send for OsThreadApi
impl Sync for OsThreadApi
impl Unpin for OsThreadApi
impl UnwindSafe for OsThreadApi
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more