Skip to content

Commit 7c3b8c7

Browse files
committed
Name thread client methods consistantly
1 parent af4f6cb commit 7c3b8c7

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

lib/debug/session.rb

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -148,15 +148,15 @@ def activate on_fork: false
148148

149149
# Thread management
150150
setup_threads
151-
thc = thread_client Thread.current
151+
thc = get_thread_client Thread.current
152152
thc.is_management
153153

154-
if @ui.respond_to?(:reader_thread) && thc = thread_client(@ui.reader_thread)
154+
if @ui.respond_to?(:reader_thread) && thc = get_thread_client(@ui.reader_thread)
155155
thc.is_management
156156
end
157157

158158
@tp_thread_begin = TracePoint.new(:thread_begin) do |tp|
159-
thread_client
159+
get_thread_client
160160
end
161161
@tp_thread_begin.enable
162162

@@ -169,7 +169,7 @@ def activate on_fork: false
169169
end
170170

171171
def deactivate
172-
thread_client.deactivate
172+
get_thread_client.deactivate
173173
@thread_stopper.disable
174174
@tp_load_script.disable
175175
@tp_thread_begin.disable
@@ -903,7 +903,7 @@ def process_command line
903903
when nil, 'list', 'l'
904904
thread_list
905905
when /(\d+)/
906-
thread_switch $1.to_i
906+
switch_thread $1.to_i
907907
else
908908
@ui.puts "unknown thread command: #{arg}"
909909
end
@@ -1017,7 +1017,7 @@ def process_command line
10171017
def repl_open_setup
10181018
@tp_thread_begin.disable
10191019
@ui.activate self
1020-
if @ui.respond_to?(:reader_thread) && thc = thread_client(@ui.reader_thread)
1020+
if @ui.respond_to?(:reader_thread) && thc = get_thread_client(@ui.reader_thread)
10211021
thc.is_management
10221022
end
10231023
@tp_thread_begin.enable
@@ -1345,7 +1345,7 @@ def managed_thread_clients
13451345
thcs
13461346
end
13471347

1348-
def thread_switch n
1348+
def switch_thread n
13491349
thcs, _unmanaged_ths = update_thread_list
13501350

13511351
if tc = thcs[n]
@@ -1366,7 +1366,7 @@ def setup_threads
13661366
if tc = prev_clients[th]
13671367
@th_clients[th] = tc
13681368
else
1369-
thread_client_create(th)
1369+
create_thread_client(th)
13701370
end
13711371
}
13721372
end
@@ -1375,11 +1375,11 @@ def on_thread_begin th
13751375
if @th_clients.has_key? th
13761376
# TODO: NG?
13771377
else
1378-
thread_client_create th
1378+
create_thread_client th
13791379
end
13801380
end
13811381

1382-
private def thread_client_create th
1382+
private def create_thread_client th
13831383
# TODO: Ractor support
13841384
raise "Only session_server can create thread_client" unless Thread.current == @session_server
13851385
@th_clients[th] = ThreadClient.new((@tc_id += 1), @q_evt, Queue.new, th)
@@ -1396,12 +1396,12 @@ def on_thread_begin th
13961396
end
13971397

13981398
# can be called by other threads
1399-
def thread_client th = Thread.current
1399+
def get_thread_client th = Thread.current
14001400
if @th_clients.has_key? th
14011401
@th_clients[th]
14021402
else
14031403
if Thread.current == @session_server
1404-
thread_client_create th
1404+
create_thread_client th
14051405
else
14061406
ask_thread_client th
14071407
end

lib/debug/thread_client.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def self.current
2222
if thc = Thread.current[:DEBUGGER__ThreadClient]
2323
thc
2424
else
25-
thc = SESSION.thread_client
25+
thc = SESSION.get_thread_client
2626
Thread.current[:DEBUGGER__ThreadClient] = thc
2727
end
2828
end

0 commit comments

Comments
 (0)