fix(kernel): fix kill wait-queue cleanup, RegionId tracking, ReleasePages ownership, and SwitchTo scheduler state
This commit is contained in:
@@ -61,6 +61,14 @@ impl Endpoint {
|
||||
!self.waiting_receivers.is_empty()
|
||||
}
|
||||
|
||||
pub fn remove_sender(&mut self, thread: ThreadId) -> bool {
|
||||
self.waiting_senders.remove_thread(thread)
|
||||
}
|
||||
|
||||
pub fn remove_receiver(&mut self, thread: ThreadId) -> bool {
|
||||
self.waiting_receivers.remove_thread(thread)
|
||||
}
|
||||
|
||||
pub fn revoke(&mut self) {
|
||||
self.generation = self.generation.next();
|
||||
}
|
||||
@@ -97,6 +105,15 @@ impl EndpointTable {
|
||||
pub fn destroy(&mut self, id: EndpointId) -> Option<Endpoint> {
|
||||
self.endpoints.get_mut(id.raw() as usize).and_then(|s| s.take())
|
||||
}
|
||||
|
||||
pub fn remove_thread_from_all(&mut self, thread: ThreadId) {
|
||||
for slot in &mut self.endpoints {
|
||||
if let Some(ep) = slot {
|
||||
ep.remove_sender(thread);
|
||||
ep.remove_receiver(thread);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub trait MessagePassing {
|
||||
|
||||
Reference in New Issue
Block a user