mirror of https://github.com/m-labs/artiq.git
Rust: unborrow cache after kernel stops.
This commit is contained in:
parent
e92f20546a
commit
3e829d0d01
|
@ -44,4 +44,10 @@ impl Cache {
|
||||||
});
|
});
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub unsafe fn unborrow(&mut self) {
|
||||||
|
for (_key, entry) in self.entries.iter_mut() {
|
||||||
|
entry.borrowed = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -381,6 +381,7 @@ fn process_kern_message(waiter: Waiter,
|
||||||
kern::RunFinished => {
|
kern::RunFinished => {
|
||||||
kernel::stop();
|
kernel::stop();
|
||||||
session.kernel_state = KernelState::Absent;
|
session.kernel_state = KernelState::Absent;
|
||||||
|
unsafe { session.congress.cache.unborrow() }
|
||||||
|
|
||||||
match stream {
|
match stream {
|
||||||
None => return Ok(true),
|
None => return Ok(true),
|
||||||
|
@ -392,6 +393,7 @@ fn process_kern_message(waiter: Waiter,
|
||||||
kern::RunException { exception: ref exn, backtrace } => {
|
kern::RunException { exception: ref exn, backtrace } => {
|
||||||
kernel::stop();
|
kernel::stop();
|
||||||
session.kernel_state = KernelState::Absent;
|
session.kernel_state = KernelState::Absent;
|
||||||
|
unsafe { session.congress.cache.unborrow() }
|
||||||
|
|
||||||
match stream {
|
match stream {
|
||||||
None => {
|
None => {
|
||||||
|
|
Loading…
Reference in New Issue