# File lib/log4r/MDC.rb, line 19 def self.check_thread_instance() # need to interlock here, so that if # another thread is entering this section # of code before the main thread does, # then the main thread copy of the MDC # is setup before then attempting to clone # it off if ( Thread.current[MDCNAME] == nil ) then $globalMDCLock.synchronize do if ( Thread.main[MDCNAME] == nil ) then Thread.main[MDCNAME] = Hash.new end if ( Thread.current != Thread.main ) then Thread.current[MDCNAME] = Hash.new Thread.main[MDCNAME].each{ |k,v| Thread.current[MDCNAME][k] = v } end end end end