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
vagrant-unbundled-2.2.19.0 vendor/bundle/ruby/3.0.0/gems/log4r-1.1.10/lib/log4r/GDC.rb
vagrant-unbundled-2.2.18.0 vendor/bundle/ruby/3.0.0/gems/log4r-1.1.10/lib/log4r/GDC.rb
vagrant-unbundled-2.2.16.0 vendor/bundle/ruby/3.0.0/gems/log4r-1.1.10/lib/log4r/GDC.rb
vagrant-unbundled-2.2.16.0 vendor/bundle/ruby/2.7.0/gems/log4r-1.1.10/lib/log4r/GDC.rb
vagrant-unbundled-2.2.14.0 vendor/bundle/ruby/2.7.0/gems/log4r-1.1.10/lib/log4r/GDC.rb
vagrant-unbundled-2.2.10.0 vendor/bundle/ruby/2.7.0/gems/log4r-1.1.10/lib/log4r/GDC.rb
vagrant-unbundled-2.2.9.0 vendor/bundle/ruby/2.7.0/gems/log4r-1.1.10/lib/log4r/GDC.rb
vagrant-unbundled-2.2.8.0 vendor/bundle/ruby/2.7.0/gems/log4r-1.1.10/lib/log4r/GDC.rb
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.4.0/gems/log4r-1.1.10/lib/log4r/GDC.rb
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.7.0/gems/log4r-1.1.10/lib/log4r/GDC.rb
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.6.0/gems/log4r-1.1.10/lib/log4r/GDC.rb
vagrant-unbundled-2.2.6.2 vendor/bundle/ruby/2.6.0/gems/log4r-1.1.10/lib/log4r/GDC.rb
vagrant-unbundled-2.2.6.1 vendor/bundle/ruby/2.6.0/gems/log4r-1.1.10/lib/log4r/GDC.rb
vagrant-unbundled-2.2.6.0 vendor/bundle/ruby/2.6.0/gems/log4r-1.1.10/lib/log4r/GDC.rb
vagrant-unbundled-2.2.5.0 vendor/bundle/ruby/2.5.0/gems/log4r-1.1.10/lib/log4r/GDC.rb
vagrant-unbundled-2.2.5.0 vendor/bundle/ruby/2.6.0/gems/log4r-1.1.10/lib/log4r/GDC.rb
vagrant-unbundled-2.2.4.0 vendor/bundle/ruby/2.5.0/gems/log4r-1.1.10/lib/log4r/GDC.rb
vagrant-unbundled-2.2.4.0 vendor/bundle/ruby/2.6.0/gems/log4r-1.1.10/lib/log4r/GDC.rb
vagrant-unbundled-2.2.3.0 vendor/bundle/ruby/2.5.0/gems/log4r-1.1.10/lib/log4r/GDC.rb
vagrant-unbundled-2.2.2.0 vendor/bundle/ruby/2.5.0/gems/log4r-1.1.10/lib/log4r/GDC.rb