mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-27 19:33:23 +00:00
Optimize the ThreadStatus
to be lock-free
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
0eaa6e637d
commit
27bcece750
@ -56,11 +56,9 @@ impl KernelThreadExt for Thread {
|
||||
|
||||
fn join(&self) {
|
||||
loop {
|
||||
let status = self.status.lock();
|
||||
if status.is_exited() {
|
||||
if self.status().is_exited() {
|
||||
return;
|
||||
} else {
|
||||
drop(status);
|
||||
Thread::yield_now();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user