kernel: fix compile errors from futex_wake_index and stack mmap

- syscall/futex.rs: scope the context write guard so futexes.swap_remove
  can borrow mutably after the guard drops
- syscall/process.rs: add missing 'shared' arg to Grant::zeroed
This commit is contained in:
2026-07-10 23:28:07 +03:00
parent fcfdd2ad09
commit 74f8c118f8
2 changed files with 15 additions and 7 deletions
+14 -7
View File
@@ -201,15 +201,22 @@ pub fn futex(
i += 1;
continue;
}
let mut context = futex.context_lock.write(token.token());
if let Some(index) = futex.waitv_index {
if context.futex_wake_index.is_none() {
context.futex_wake_index = Some(index);
let should_wake = {
let mut context = futex.context_lock.write(token.token());
if let Some(index) = futex.waitv_index {
if context.futex_wake_index.is_none() {
context.futex_wake_index = Some(index);
}
}
context.unblock();
true
};
if should_wake {
futexes.swap_remove(i);
woken += 1;
} else {
i += 1;
}
context.unblock();
futexes.swap_remove(i);
woken += 1;
}
futexes.is_empty()
+1
View File
@@ -332,6 +332,7 @@ pub unsafe fn usermode_bootstrap(bootstrap: &Bootstrap, token: &mut CleanLockTok
flags,
mapper,
flusher,
false, // private mapping for bootstrap stack
)?)
},
);