Skip to content

Commit

Permalink
Use actual per-thread variable.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix authored and ko1 committed Dec 8, 2023
1 parent 6716762 commit bfe9568
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions lib/debug/thread_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@

require_relative 'color'

class ::Thread
attr_accessor :debug_thread_client
end

module DEBUGGER__
M_INSTANCE_VARIABLES = method(:instance_variables).unbind
M_INSTANCE_VARIABLE_GET = method(:instance_variable_get).unbind
Expand Down Expand Up @@ -48,12 +52,7 @@ def safe_global_variables

class ThreadClient
def self.current
if thc = Thread.current[:DEBUGGER__ThreadClient]
thc
else
thc = SESSION.get_thread_client
Thread.current[:DEBUGGER__ThreadClient] = thc
end
Thread.current.debug_thread_client ||= SESSION.get_thread_client
end

include Color
Expand Down

0 comments on commit bfe9568

Please sign in to comment.