2
0
mirror of https://github.com/m-labs/artiq.git synced 2024-12-28 20:53:35 +08:00

Rust: unborrow cache after kernel stops.

This commit is contained in:
whitequark 2016-10-06 14:19:12 +00:00
parent e92f20546a
commit 3e829d0d01
2 changed files with 8 additions and 0 deletions

View File

@ -44,4 +44,10 @@ impl Cache {
});
Ok(())
}
pub unsafe fn unborrow(&mut self) {
for (_key, entry) in self.entries.iter_mut() {
entry.borrowed = false;
}
}
}

View File

@ -381,6 +381,7 @@ fn process_kern_message(waiter: Waiter,
kern::RunFinished => {
kernel::stop();
session.kernel_state = KernelState::Absent;
unsafe { session.congress.cache.unborrow() }
match stream {
None => return Ok(true),
@ -392,6 +393,7 @@ fn process_kern_message(waiter: Waiter,
kern::RunException { exception: ref exn, backtrace } => {
kernel::stop();
session.kernel_state = KernelState::Absent;
unsafe { session.congress.cache.unborrow() }
match stream {
None => {