Stage2: multiple user threads based on uniprocessor, see new added test race_adder and threads.
This commit is contained in:
parent
4fa4e9cab4
commit
a341b338c8
12 changed files with 254 additions and 57 deletions
|
@ -106,3 +106,14 @@ pub fn sleep(period_ms: usize) {
|
|||
sys_yield();
|
||||
}
|
||||
}
|
||||
|
||||
pub fn thread_create(entry: usize) -> isize { sys_thread_create(entry) }
|
||||
pub fn gettid() -> isize { sys_gettid() }
|
||||
pub fn waittid(tid: usize) -> isize {
|
||||
loop {
|
||||
match sys_waittid(tid) {
|
||||
-2 => { yield_(); }
|
||||
exit_code => return exit_code,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue