runtime: clear async RPC queue when kernel stops (fixes #631).

This commit is contained in:
whitequark 2016-11-29 14:00:43 +00:00
parent 852598c491
commit 5b7e068157
2 changed files with 7 additions and 5 deletions

View File

@ -21,9 +21,11 @@ pub unsafe fn start() {
rpc_queue::init();
}
pub fn stop() {
unsafe { csr::kernel_cpu::reset_write(1) }
pub unsafe fn stop() {
csr::kernel_cpu::reset_write(1);
mailbox::acknowledge();
rpc_queue::init();
}
pub fn validate(ptr: usize) -> bool {

View File

@ -92,7 +92,7 @@ impl<'a> Session<'a> {
impl<'a> Drop for Session<'a> {
fn drop(&mut self) {
kernel::stop()
unsafe { kernel::stop() }
}
}
@ -416,7 +416,7 @@ fn process_kern_message(waiter: Waiter,
}
&kern::RunFinished => {
kernel::stop();
unsafe { kernel::stop() }
session.kernel_state = KernelState::Absent;
unsafe { session.congress.cache.unborrow() }
@ -428,7 +428,7 @@ fn process_kern_message(waiter: Waiter,
}
&kern::RunException { exception: ref exn, backtrace } => {
kernel::stop();
unsafe { kernel::stop() }
session.kernel_state = KernelState::Absent;
unsafe { session.congress.cache.unborrow() }