Sha256: 2b8f55ed89d28a856b46c54359094627c7107a61c323e165d3560ceedf6d4947
Contents?: true
Size: 786 Bytes
Versions: 126
Compression:
Stored size: 786 Bytes
Contents
# :include: rdoc/GDC # # == Other Info # # Version:: $Id$ # Author:: Colby Gutierrez-Kraybill <colby(at)astro.berkeley.edu> require 'monitor' module Log4r GDCNAME = "log4rGDC" $globalGDCLock = Monitor.new # See log4r/GDC.rb class GDC < Monitor private_class_method :new def self.clear() Thread.main[GDCNAME] = "" end def self.get() $globalGDCLock.synchronize do if ( Thread.main[GDCNAME] == nil ) then Thread.main[GDCNAME] = $0 end end return Thread.main[GDCNAME] end def self.set( a_name ) if ( Thread.current != Thread.main ) then raise "Can only initialize Global Diagnostic Context from Thread.main" end $globalGDCLock.synchronize do Thread.main[GDCNAME] = a_name end end end end
Version data entries
126 entries across 88 versions & 16 rubygems