forked from Rativel/BurritOS
try to implement join
This commit is contained in:
committed by
François Autin
parent
31f1e760e9
commit
c6f5818059
@@ -1,7 +1,7 @@
|
||||
use std::{rc::Rc, cell::RefCell};
|
||||
|
||||
use super::process::Process;
|
||||
use crate::{simulator::machine::{NUM_INT_REGS, NUM_FP_REGS, STACK_REG}};
|
||||
use super::{process::Process, thread_manager::ThreadRef};
|
||||
use crate::{simulator::machine::{NUM_INT_REGS, NUM_FP_REGS, STACK_REG}, utility::list::List};
|
||||
|
||||
const STACK_FENCEPOST: u32 = 0xdeadbeef;
|
||||
|
||||
@@ -26,7 +26,7 @@ pub struct Thread {
|
||||
name: String,
|
||||
pub process: Option<Rc<RefCell<Process>>>,
|
||||
pub thread_context: ThreadContext,
|
||||
pub stack_pointer: i32,
|
||||
pub join_thread: List<ThreadRef>,
|
||||
}
|
||||
|
||||
impl Thread {
|
||||
@@ -40,9 +40,9 @@ impl Thread {
|
||||
thread_context: ThreadContext {
|
||||
int_registers: [0; NUM_INT_REGS],
|
||||
float_registers: [0f32; NUM_FP_REGS],
|
||||
pc: 0
|
||||
pc: 0,
|
||||
},
|
||||
stack_pointer: 0,
|
||||
join_thread: List::default(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -94,7 +94,6 @@ mod test {
|
||||
float_registers: [0f32; NUM_FP_REGS],
|
||||
pc: 0
|
||||
};
|
||||
x.stack_pointer = 0;
|
||||
x }
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user