Skip to content

Commit bbf30bc

Browse files
committed
Hold wk_lock for entire worker session, not just step commands
The previous fix only held the lock during step commands, but continue between breakpoints had the same ping-pong problem — another worker could grab the lock before the current one hit its next breakpoint. Now the wk_lock is never released in leave_subsession. Each worker keeps exclusive debugger access for its entire lifetime. Other workers queue up and get their turn when the current one exits. The kernel releases flock automatically on process exit.
1 parent 5481079 commit bbf30bc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/debug/session.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1806,9 +1806,9 @@ def get_thread_client th = Thread.current
18061806
DEBUGGER__.debug{ "Leave subsession" }
18071807
bp_sync_publish # publish breakpoint changes to other processes
18081808
@process_group.unlock
1809-
# Keep wk_lock held during step commands so the same worker
1810-
# re-enters the subsession without yielding to a sibling.
1811-
@process_group.unlock_wk_lock if type == :continue
1809+
# Never release wk_lock here — the current worker keeps exclusive
1810+
# debugger access until its session ends. Other workers queue up.
1811+
# The kernel releases flock automatically on process exit.
18121812
restart_all_threads
18131813
else
18141814
DEBUGGER__.debug{ "Leave subsession (nested #{@subsession_stack.size})" }

0 commit comments

Comments
 (0)