mirror of https://github.com/m-labs/artiq.git
runtime: clear async RPC queue when kernel stops (fixes #631).
This commit is contained in:
parent
852598c491
commit
5b7e068157
|
@ -21,9 +21,11 @@ pub unsafe fn start() {
|
||||||
rpc_queue::init();
|
rpc_queue::init();
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn stop() {
|
pub unsafe fn stop() {
|
||||||
unsafe { csr::kernel_cpu::reset_write(1) }
|
csr::kernel_cpu::reset_write(1);
|
||||||
|
|
||||||
mailbox::acknowledge();
|
mailbox::acknowledge();
|
||||||
|
rpc_queue::init();
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn validate(ptr: usize) -> bool {
|
pub fn validate(ptr: usize) -> bool {
|
||||||
|
|
|
@ -92,7 +92,7 @@ impl<'a> Session<'a> {
|
||||||
|
|
||||||
impl<'a> Drop for Session<'a> {
|
impl<'a> Drop for Session<'a> {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
kernel::stop()
|
unsafe { kernel::stop() }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -416,7 +416,7 @@ fn process_kern_message(waiter: Waiter,
|
||||||
}
|
}
|
||||||
|
|
||||||
&kern::RunFinished => {
|
&kern::RunFinished => {
|
||||||
kernel::stop();
|
unsafe { kernel::stop() }
|
||||||
session.kernel_state = KernelState::Absent;
|
session.kernel_state = KernelState::Absent;
|
||||||
unsafe { session.congress.cache.unborrow() }
|
unsafe { session.congress.cache.unborrow() }
|
||||||
|
|
||||||
|
@ -428,7 +428,7 @@ fn process_kern_message(waiter: Waiter,
|
||||||
}
|
}
|
||||||
|
|
||||||
&kern::RunException { exception: ref exn, backtrace } => {
|
&kern::RunException { exception: ref exn, backtrace } => {
|
||||||
kernel::stop();
|
unsafe { kernel::stop() }
|
||||||
session.kernel_state = KernelState::Absent;
|
session.kernel_state = KernelState::Absent;
|
||||||
unsafe { session.congress.cache.unborrow() }
|
unsafe { session.congress.cache.unborrow() }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue