Optimize the ThreadStatus to be lock-free

This commit is contained in:
LI Qing
2024-05-11 11:18:41 +08:00
committed by Tate, Hongliang Tian
parent 0eaa6e637d
commit 27bcece750
8 changed files with 83 additions and 53 deletions

View File

@ -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();
}
}