def inherit( obj )
      case obj
      when Hash
        Thread.current.thread_variable_set(STACK_NAME, [obj.dup])
      when Thread
        return if Thread.current == obj
        DIAGNOSTIC_MUTEX.synchronize do
          if hash = obj.thread_variable_get(STACK_NAME)
            Thread.current.thread_variable_set(STACK_NAME, [flatten(hash)])
          end
        end
      end

      self
    end
def inherit( obj )
      case obj
      when Hash
        Thread.current.thread_variable_set(STACK_NAME, [obj.dup])
      when Thread
        return if Thread.current == obj
        DIAGNOSTIC_MUTEX.synchronize do
          if hash = obj.thread_variable_get(STACK_NAME)
            Thread.current.thread_variable_set(STACK_NAME, [flatten(hash)])
          end
        end
      end

      self
    end
Public: Inherit the diagnostic context of another thread. In the vast
 majority of cases the other thread will the parent that spawned the
 current thread. The diagnostic context from the parent thread is cloned
 before being inherited; the two diagnostic contexts can be changed
 independently.

 Returns the MappedDiagnosticContext.