pub struct ThreadScheduler;Expand description
Thread scheduling and management functions for the emulator
Implementations§
Source§impl ThreadScheduler
impl ThreadScheduler
Sourcepub fn schedule_next_thread(emu: &mut Emu) -> bool
pub fn schedule_next_thread(emu: &mut Emu) -> bool
Schedule and switch to the next runnable thread (round-robin) Always tries to switch to give each thread equal time Returns true if a thread switch occurred, false otherwise
Sourcepub fn log_thread_states(emu: &Emu)
pub fn log_thread_states(emu: &Emu)
Log the current state of all threads for debugging
Sourcepub fn switch_to_thread(emu: &mut Emu, thread_id: usize) -> bool
pub fn switch_to_thread(emu: &mut Emu, thread_id: usize) -> bool
Switch execution context to a different thread
Sourcepub fn execute_thread_instruction(emu: &mut Emu, thread_id: usize) -> bool
pub fn execute_thread_instruction(emu: &mut Emu, thread_id: usize) -> bool
Execute a single instruction for a specific thread This consolidates the duplicated logic from step_thread
Sourcepub fn advance_ip(emu: &mut Emu, sz: usize)
pub fn advance_ip(emu: &mut Emu, sz: usize)
Advance the instruction pointer by the given size Handles both 32-bit and 64-bit modes, and respects force_reload flag
Sourcepub fn step_with_scheduling(emu: &mut Emu) -> bool
pub fn step_with_scheduling(emu: &mut Emu) -> bool
Main thread scheduling step - replaces the complex logic in step()
Auto Trait Implementations§
impl Freeze for ThreadScheduler
impl RefUnwindSafe for ThreadScheduler
impl Send for ThreadScheduler
impl Sync for ThreadScheduler
impl Unpin for ThreadScheduler
impl UnwindSafe for ThreadScheduler
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