module Thread::InheritableThreadVars::ThreadClassExtensions
def new(*, **, &block)
def new(*, **, &block) parent = Thread.current super do |*args| child = Thread.current if child.instance_variable_defined?(:@thread_parent) # :nocov: raise "@thread_parent has already been declared elsewhere. Bailing out instead of clobbering it!" # :nocov: end child.instance_variable_set("@thread_parent", parent) block.call(*args) end end