implemented sc_lock_release

TODO : to implement lock_release in thread_manager
This commit is contained in:
Rémi Rativel 2023-04-13 14:45:57 +02:00
parent 3244584da9
commit ec2f50f7d3
2 changed files with 9 additions and 0 deletions

View File

@ -197,6 +197,11 @@ fn syscall(machine: &mut Machine, system: &mut System) -> Result<MachineOk, Mach
} }
} }
fn sc_lock_release(machine: &mut Machine, system: &mut System) -> Result<MachineOk, MachineError>{
let id = machine.read_int_register(10) as i32;
system.get_thread_manager().lock_release(id, machine)
}
fn sc_lock_acquire(machine: &mut Machine, system: &mut System) -> Result<MachineOk, MachineError> { fn sc_lock_acquire(machine: &mut Machine, system: &mut System) -> Result<MachineOk, MachineError> {
let id = machine.read_int_register(10) as i32; let id = machine.read_int_register(10) as i32;
system.get_thread_manager().lock_acquire(id, machine) system.get_thread_manager().lock_acquire(id, machine)

View File

@ -282,6 +282,10 @@ impl ThreadManager {
} }
} }
pub fn lock_release(&mut self, id: i32, machine: &mut Machine) -> Result<MachineOk, MachineError>{
todo!()
}
/// Currently running thread /// Currently running thread
pub fn get_g_current_thread(&mut self) -> &Option<Rc<RefCell<Thread>>> { pub fn get_g_current_thread(&mut self) -> &Option<Rc<RefCell<Thread>>> {
&self.g_current_thread &self.g_current_thread