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

Version Path
depengine-0.0.26 etc/isolate/ruby-1.8/gems/log4r-1.1.8/lib/log4r/GDC.rb
depengine-0.0.26 etc/isolate/jruby-1.8/gems/log4r-1.1.8/lib/log4r/GDC.rb
depengine-0.0.25 etc/isolate/ruby-1.8/gems/log4r-1.1.8/lib/log4r/GDC.rb
depengine-0.0.25 etc/isolate/jruby-1.8/gems/log4r-1.1.8/lib/log4r/GDC.rb
depengine-0.0.24 etc/isolate/ruby-1.8/gems/log4r-1.1.8/lib/log4r/GDC.rb
depengine-0.0.24 etc/isolate/jruby-1.8/gems/log4r-1.1.8/lib/log4r/GDC.rb
depengine-0.0.23 etc/isolate/jruby-1.8/gems/log4r-1.1.8/lib/log4r/GDC.rb
depengine-0.0.23 etc/isolate/ruby-1.8/gems/log4r-1.1.8/lib/log4r/GDC.rb
depengine-0.0.22 etc/isolate/jruby-1.8/gems/log4r-1.1.8/lib/log4r/GDC.rb
depengine-0.0.22 etc/isolate/ruby-1.8/gems/log4r-1.1.8/lib/log4r/GDC.rb
depengine-0.0.21 etc/isolate/jruby-1.8/gems/log4r-1.1.8/lib/log4r/GDC.rb
depengine-0.0.21 etc/isolate/ruby-1.8/gems/log4r-1.1.8/lib/log4r/GDC.rb
depengine-0.0.20 etc/isolate/jruby-1.8/gems/log4r-1.1.8/lib/log4r/GDC.rb
depengine-0.0.20 etc/isolate/ruby-1.8/gems/log4r-1.1.8/lib/log4r/GDC.rb
depengine-0.0.19 etc/isolate/jruby-1.8/gems/log4r-1.1.8/lib/log4r/GDC.rb
depengine-0.0.19 etc/isolate/ruby-1.8/gems/log4r-1.1.8/lib/log4r/GDC.rb
mtn_log4r-1.1.12 lib/log4r/GDC.rb
mtn_log4r-1.1.11 lib/log4r/GDC.rb
vinted-log4r-1.1.11 lib/log4r/GDC.rb
tnargav-1.3.3 vendor/bundle/ruby/1.9.1/gems/log4r-1.1.10/lib/log4r/GDC.rb