Skip to content

Commit

Permalink
Don't hold lock while calling listener (#1072)
Browse files Browse the repository at this point in the history
  • Loading branch information
zaddach authored Jan 31, 2025
1 parent 24d0d9c commit 4240479
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions debugger/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,13 @@ impl DebuggerContext {
if is_done_signal.load(Ordering::SeqCst) {
return true;
}
let lock = breakpoints.lock().expect(POISONED_LOCK_PANIC);

if lock.contains(&rule) {
let contains_rule = {
let lock = breakpoints.lock().expect(POISONED_LOCK_PANIC);
lock.contains(&rule)
};

if contains_rule {
rsender
.send(DebuggerEvent::Breakpoint(rule, pos.pos()))
.expect(CHANNEL_CLOSED_PANIC);
Expand Down

0 comments on commit 4240479

Please sign in to comment.