diff --git a/artiq/runtime.rs/src/cache.rs b/artiq/runtime.rs/src/cache.rs index cc755bab6..4136b96f3 100644 --- a/artiq/runtime.rs/src/cache.rs +++ b/artiq/runtime.rs/src/cache.rs @@ -44,4 +44,10 @@ impl Cache { }); Ok(()) } + + pub unsafe fn unborrow(&mut self) { + for (_key, entry) in self.entries.iter_mut() { + entry.borrowed = false; + } + } } diff --git a/artiq/runtime.rs/src/session.rs b/artiq/runtime.rs/src/session.rs index 644381ea8..5b135b226 100644 --- a/artiq/runtime.rs/src/session.rs +++ b/artiq/runtime.rs/src/session.rs @@ -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 => {