Ensure all threads stop in exit().

This commit is contained in:
4lDO2
2024-07-16 20:33:37 +02:00
parent 79bbf79656
commit 8de850e7e9
+7 -1
View File
@@ -30,7 +30,13 @@ use crate::{
use super::usercopy::UserSliceWo;
pub fn exit_context(context_lock: Arc<RwSpinlock<Context>>) {
// TODO: Stop context?
if !context::is_current(&context_lock) {
context_lock.write().status = context::Status::Dead;
while context_lock.read().running {
context::switch();
}
}
let close_files;
let addrspace_opt;