pub struct SpinLockGuard<'lock, K: Kernel, T> {
lock: &'lock SpinLock<K, T>,
_preempt_guard: PreemptDisableGuard<K>,
_inner_guard: <<K as Arch>::BareSpinLock as BareSpinLock>::Guard<'lock>,
}Fields§
§lock: &'lock SpinLock<K, T>§_preempt_guard: PreemptDisableGuard<K>§_inner_guard: <<K as Arch>::BareSpinLock as BareSpinLock>::Guard<'lock>Implementations§
Source§impl<K: Kernel> SpinLockGuard<'_, K, SchedulerState<K>>
impl<K: Kernel> SpinLockGuard<'_, K, SchedulerState<K>>
Sourcepub(super) fn try_reschedule(self, kernel: K, reason: RescheduleReason) -> Self
pub(super) fn try_reschedule(self, kernel: K, reason: RescheduleReason) -> Self
Reschedule if preemption is enabled
fn thread_initialize( &self, _kernel: K, thread: &mut Thread<K>, process_handle: ProcessHandle<K>, ) -> Result<()>
pub fn thread_initialize_kernel<A: ThreadArg>( &mut self, kernel: K, thread: &mut Thread<K>, entry_point: fn(K, A), arg: A, )
pub fn thread_reinitialize_kernel<A: ThreadArg>( &mut self, kernel: K, thread: &mut Thread<K>, entry_point: fn(K, A), arg: A, )
Sourcepub unsafe fn thread_initialize_non_priv(
&mut self,
kernel: K,
thread: &mut Thread<K>,
process_handle: ProcessHandle<K>,
initial_pc: usize,
initial_sp: usize,
args: (usize, usize, usize),
) -> Result<()>
pub unsafe fn thread_initialize_non_priv( &mut self, kernel: K, thread: &mut Thread<K>, process_handle: ProcessHandle<K>, initial_pc: usize, initial_sp: usize, args: (usize, usize, usize), ) -> Result<()>
§Safety
It is up to the caller to ensure that *process is valid. Initialize the mutable parts of the non privileged thread, must be called once per thread prior to starting it
pub(crate) fn thread_get_state(&self, thread: &ThreadHandle<K>) -> State
Sourcepub fn thread_terminate(
&mut self,
thread_handle: &mut ThreadHandle<K>,
status: ExitStatus,
) -> Result<()>
pub fn thread_terminate( &mut self, thread_handle: &mut ThreadHandle<K>, status: ExitStatus, ) -> Result<()>
Request termination of the referenced thread.
This is an ASYNCHRONOUS operation. The thread is marked as terminating, but it may not exit immediately.
pub(crate) fn thread_terminate_internal( &mut self, thread: &mut Thread<K>, status: ExitStatus, ) -> Result<()>
pub(crate) fn thread_signal_join( self, kernel: K, thread: &mut ThreadHandle<K>, ) -> Self
pub(crate) fn thread_try_join( self, kernel: K, thread_handle: ThreadHandle<K>, signaler: Option<EventSignaler<K>>, ) -> (Self, TryJoinResult<K>)
pub(crate) fn thread_cancel_try_join( &mut self, thread_handle: &mut ThreadHandle<K>, )
Sourcepub(crate) fn thread_exit(self, kernel: K)
pub(crate) fn thread_exit(self, kernel: K)
Performs the low-level operations to exit the current thread.
This method handles the actual state transitions and cleanup for thread exit.
It expects the exit_status to have been set by the caller if necessary.
§Differences from other exit/terminate functions:
exit_thread: A high-level wrapper that takes an explicit status, sets it on the thread, and then calls this method. It does not return.terminate: Asynchronous requests to terminate a thread/process. They set the target’s state to terminating but rely onthread_exitbeing called later to perform the actual exit.
pub(crate) fn thread_is_terminating(&self, thread: &ThreadHandle<K>) -> bool
fn thread_remove_from_parent_process( self, kernel: K, thread: &mut Thread<K>, ) -> Self
Source§impl<K: Kernel> SpinLockGuard<'_, K, SchedulerState<K>>
impl<K: Kernel> SpinLockGuard<'_, K, SchedulerState<K>>
Sourcepub fn process_terminate(
&mut self,
_kernel: K,
process_handle: &ProcessHandle<K>,
status: ExitStatus,
)
pub fn process_terminate( &mut self, _kernel: K, process_handle: &ProcessHandle<K>, status: ExitStatus, )
Request termination of the referenced process and all its threads.
This is an ASYNCHRONOUS operation. The process and its threads are marked as terminating, but they may not exit immediately.
pub fn process_signal_join( self, kernel: K, process: &mut ProcessHandle<K>, ) -> Self
pub fn process_try_join( self, kernel: K, process_handle: ProcessHandle<K>, signaler: Option<EventSignaler<K>>, ) -> (Self, ProcessTryJoinResult<K>)
pub fn process_cancel_try_join(&mut self, process_handle: &mut ProcessHandle<K>)
Sourceunsafe fn process_remove_from_thread_list(
self,
kernel: K,
process_handle: &mut ProcessHandle<K>,
thread: &mut Thread<K>,
) -> Self
unsafe fn process_remove_from_thread_list( self, kernel: K, process_handle: &mut ProcessHandle<K>, thread: &mut Thread<K>, ) -> Self
§Safety
Caller must ensure that the thread is already in the processes thread list.