Optimized to avoid cloning heap values
This commit is contained in:
parent
8b3a3bebe7
commit
69f91170f6
@ -65,16 +65,12 @@ fn syscall(machine: &mut Machine, system: &mut System) -> Result<MachineOk, Mach
|
|||||||
match call_type {
|
match call_type {
|
||||||
SC_SHUTDOWN => Ok(MachineOk::Shutdown),
|
SC_SHUTDOWN => Ok(MachineOk::Shutdown),
|
||||||
SC_EXIT => {
|
SC_EXIT => {
|
||||||
match &system.get_thread_manager().g_current_thread {
|
let th = match &system.get_thread_manager().g_current_thread {
|
||||||
Some(th) => {
|
Some(th) => th,
|
||||||
let th = Rc::clone(th);
|
None => Err("Current thread is None".into())
|
||||||
system.get_thread_manager().thread_finish(machine, th);
|
}?;
|
||||||
Ok(MachineOk::Ok)
|
system.get_thread_manager().thread_finish(machine, th);
|
||||||
},
|
Ok(MachineOk::Ok)
|
||||||
None => {
|
|
||||||
Err("Current thread is None".into())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
SC_EXEC => todo!(),
|
SC_EXEC => todo!(),
|
||||||
SC_JOIN => todo!(),
|
SC_JOIN => todo!(),
|
||||||
|
Loading…
Reference in New Issue
Block a user