Skip to content

Commit

Permalink
Only apply TracePoint to current thread
Browse files Browse the repository at this point in the history
  • Loading branch information
arkadiyt committed May 20, 2018
1 parent ca54cf8 commit fddb599
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/webmock/http_lib_adapters/net_http.rb
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,10 @@ def initialize(io, read_timeout: 60, continue_timeout: nil, debug_output: nil)

if RUBY_VERSION >= '2.6.0'
def rbuf_fill
current_thread_id = Thread.current.object_id

trace = TracePoint.trace(:line) do |tp|
next unless Thread.current.object_id == current_thread_id
if tp.binding.local_variable_defined?(:tmp)
tp.binding.local_variable_set(:tmp, nil)
end
Expand Down

0 comments on commit fddb599

Please sign in to comment.