Sha256: e637b743f96df1d729933b105118f688f3a3dec712ae873bee1a3e7076bab97f

Contents?: true

Size: 1015 Bytes

Versions: 99

Compression:

Stored size: 1015 Bytes

Contents

module Concurrent
  module Synchronization

    if Concurrent.on_jruby? && Concurrent.java_extensions_loaded?

      module JRubyAttrVolatile
        def self.included(base)
          base.extend(ClassMethods)
        end

        module ClassMethods
          def attr_volatile(*names)
            names.each do |name|

              ivar = :"@volatile_#{name}"

              class_eval <<-RUBY, __FILE__, __LINE__ + 1
                def #{name}
                  instance_variable_get_volatile(:#{ivar})
                end

                def #{name}=(value)
                  instance_variable_set_volatile(:#{ivar}, value)
                end
              RUBY

            end
            names.map { |n| [n, :"#{n}="] }.flatten
          end
        end
      end

      # @!visibility private
      # @!macro internal_implementation_note
      class JRubyObject < AbstractObject
        include JRubyAttrVolatile

        def initialize
          # nothing to do
        end
      end
    end
  end
end

Version data entries

99 entries across 89 versions & 25 rubygems

Version Path
logstash-filter-csharp-0.2.1 vendor/bundle/jruby/2.3.0/gems/concurrent-ruby-1.0.0-java/lib/concurrent/synchronization/jruby_object.rb
logstash-filter-csharp-0.2.0 vendor/bundle/jruby/2.3.0/gems/concurrent-ruby-1.0.0-java/lib/concurrent/synchronization/jruby_object.rb
files.com-1.0.55 docs/vendor/bundle/ruby/2.5.0/gems/concurrent-ruby-1.1.4/lib/concurrent/synchronization/jruby_object.rb
vagrant-unbundled-2.2.5.0 vendor/bundle/ruby/2.5.0/gems/concurrent-ruby-1.1.4/lib/concurrent/synchronization/jruby_object.rb
vagrant-unbundled-2.2.5.0 vendor/bundle/ruby/2.5.0/gems/concurrent-ruby-1.1.3/lib/concurrent/synchronization/jruby_object.rb
vagrant-unbundled-2.2.4.0 vendor/bundle/ruby/2.5.0/gems/concurrent-ruby-1.1.4/lib/concurrent/synchronization/jruby_object.rb
vagrant-unbundled-2.2.4.0 vendor/bundle/ruby/2.5.0/gems/concurrent-ruby-1.1.3/lib/concurrent/synchronization/jruby_object.rb
vagrant-unbundled-2.2.3.0 vendor/bundle/ruby/2.5.0/gems/concurrent-ruby-1.1.4/lib/concurrent/synchronization/jruby_object.rb
vagrant-unbundled-2.2.3.0 vendor/bundle/ruby/2.5.0/gems/concurrent-ruby-1.1.3/lib/concurrent/synchronization/jruby_object.rb
tdiary-5.0.11 vendor/bundle/gems/concurrent-ruby-1.0.5/lib/concurrent/synchronization/jruby_object.rb
tdiary-5.0.11 vendor/bundle/gems/concurrent-ruby-1.1.4/lib/concurrent/synchronization/jruby_object.rb
nullifyable-0.1.0 vendor/bundle/gems/concurrent-ruby-1.1.4/lib/concurrent/synchronization/jruby_object.rb
concurrent-ruby-1.1.4 lib/concurrent/synchronization/jruby_object.rb
vagrant-unbundled-2.2.2.0 vendor/bundle/ruby/2.5.0/gems/concurrent-ruby-1.1.3/lib/concurrent/synchronization/jruby_object.rb
concurrent-ruby-1.1.3 lib/concurrent/synchronization/jruby_object.rb
concurrent-ruby-1.1.2 lib/concurrent/synchronization/jruby_object.rb
concurrent-ruby-1.1.1 lib/concurrent/synchronization/jruby_object.rb
concurrent-ruby-1.1.0.pre2 lib/concurrent/synchronization/jruby_object.rb
concurrent-ruby-1.1.0.pre1 lib/concurrent/synchronization/jruby_object.rb
sprokovuln-0.2.0 vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/synchronization/jruby_object.rb