Skip to content

Commit 43e1bb7

Browse files
committed
fix(port_std): release a lock on int_state before calling an interrupt handler
1 parent e18bf61 commit 43e1bb7

File tree

1 file changed

+4
-3
lines changed
  • src/constance_port_std/src

1 file changed

+4
-3
lines changed

src/constance_port_std/src/lib.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -325,9 +325,10 @@ impl State {
325325
//
326326

327327
// Check pending interrupts
328-
while let Some((num, pri, f)) =
329-
(self.int_state.lock().as_mut().unwrap()).take_highest_pended_priority()
330-
{
328+
while let Some((num, pri, f)) = {
329+
let mut int_state = self.int_state.lock();
330+
int_state.as_mut().unwrap().take_highest_pended_priority()
331+
} {
331332
*self.active_int_priority.lock() = pri;
332333

333334
log::trace!(

0 commit comments

Comments
 (0)