Skip to content

Commit 4240479

Browse files
authored
Don't hold lock while calling listener (#1072)
1 parent 24d0d9c commit 4240479

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

debugger/src/lib.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,13 @@ impl DebuggerContext {
252252
if is_done_signal.load(Ordering::SeqCst) {
253253
return true;
254254
}
255-
let lock = breakpoints.lock().expect(POISONED_LOCK_PANIC);
256255

257-
if lock.contains(&rule) {
256+
let contains_rule = {
257+
let lock = breakpoints.lock().expect(POISONED_LOCK_PANIC);
258+
lock.contains(&rule)
259+
};
260+
261+
if contains_rule {
258262
rsender
259263
.send(DebuggerEvent::Breakpoint(rule, pos.pos()))
260264
.expect(CHANNEL_CLOSED_PANIC);

0 commit comments

Comments
 (0)