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:
+14
-7
@@ -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()
|
||||
|
||||
@@ -332,6 +332,7 @@ pub unsafe fn usermode_bootstrap(bootstrap: &Bootstrap, token: &mut CleanLockTok
|
||||
flags,
|
||||
mapper,
|
||||
flusher,
|
||||
false, // private mapping for bootstrap stack
|
||||
)?)
|
||||
},
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user