Sha256: a6bbe7a3bc2a5e1751f574d9ca0167474a5dfb06108b73cc358330a5d0585776

Contents?: true

Size: 691 Bytes

Versions: 163

Compression:

Stored size: 691 Bytes

Contents

require 'concurrent/atomic/abstract_thread_local_var'

if Concurrent.on_jruby?

  module Concurrent

    # @!visibility private
    # @!macro internal_implementation_note
    class JavaThreadLocalVar < AbstractThreadLocalVar

      # @!macro thread_local_var_method_get
      def value
        value = @var.get

        if value.nil?
          default
        elsif value == NULL
          nil
        else
          value
        end
      end

      # @!macro thread_local_var_method_set
      def value=(value)
        @var.set(value)
      end

      protected

      # @!visibility private
      def allocate_storage
        @var = java.lang.ThreadLocal.new
      end
    end
  end
end

Version data entries

163 entries across 145 versions & 34 rubygems

Version Path
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/concurrent-ruby-1.1.10/lib/concurrent-ruby/concurrent/atomic/java_thread_local_var.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/concurrent-ruby-1.1.9/lib/concurrent-ruby/concurrent/atomic/java_thread_local_var.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/concurrent-ruby-1.1.10/lib/concurrent-ruby/concurrent/atomic/java_thread_local_var.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/concurrent-ruby-1.1.9/lib/concurrent-ruby/concurrent/atomic/java_thread_local_var.rb
rubypitaya-3.12.5 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/concurrent-ruby-1.1.10/lib/concurrent-ruby/concurrent/atomic/java_thread_local_var.rb
rubypitaya-3.12.4 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/concurrent-ruby-1.1.10/lib/concurrent-ruby/concurrent/atomic/java_thread_local_var.rb
rubypitaya-3.12.3 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/concurrent-ruby-1.1.10/lib/concurrent-ruby/concurrent/atomic/java_thread_local_var.rb
rubypitaya-3.12.2 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/concurrent-ruby-1.1.10/lib/concurrent-ruby/concurrent/atomic/java_thread_local_var.rb
o-concurrent-ruby-1.1.13 lib/concurrent-ruby/concurrent/atomic/java_thread_local_var.rb
o-concurrent-ruby-1.1.12 lib/concurrent-ruby/concurrent/atomic/java_thread_local_var.rb
o-concurrent-ruby-1.1.11 lib/concurrent-ruby/concurrent/atomic/java_thread_local_var.rb
concurrent-ruby-1.1.10 lib/concurrent-ruby/concurrent/atomic/java_thread_local_var.rb
ric-0.14.2 vendor/bundle/ruby/2.7.0/gems/concurrent-ruby-1.1.9/lib/concurrent-ruby/concurrent/atomic/java_thread_local_var.rb
ric-0.14.1 vendor/bundle/ruby/2.7.0/gems/concurrent-ruby-1.1.9/lib/concurrent-ruby/concurrent/atomic/java_thread_local_var.rb
phillipug-foodie-0.1.0 .vendor/ruby/3.0.0/gems/concurrent-ruby-1.1.9/lib/concurrent-ruby/concurrent/atomic/java_thread_local_var.rb
ric-0.14.0 vendor/bundle/ruby/2.7.0/gems/concurrent-ruby-1.1.9/lib/concurrent-ruby/concurrent/atomic/java_thread_local_var.rb
vagrant-unbundled-2.2.19.0 vendor/bundle/ruby/3.0.0/gems/concurrent-ruby-1.1.9/lib/concurrent-ruby/concurrent/atomic/java_thread_local_var.rb
date_n_time_picker_activeadmin-0.1.2 vendor/bundle/ruby/2.6.0/gems/concurrent-ruby-1.1.9/lib/concurrent-ruby/concurrent/atomic/java_thread_local_var.rb
date_n_time_picker_activeadmin-0.1.1 vendor/bundle/ruby/2.6.0/gems/concurrent-ruby-1.1.9/lib/concurrent-ruby/concurrent/atomic/java_thread_local_var.rb
vagrant-unbundled-2.2.18.0 vendor/bundle/ruby/3.0.0/gems/concurrent-ruby-1.1.9/lib/concurrent-ruby/concurrent/atomic/java_thread_local_var.rb