Sha256: e7c9029f05a42a2d41fed7f6e067fac91a8aeb029d9a2c6003306fc168f31a53

Contents?: true

Size: 723 Bytes

Versions: 89

Compression:

Stored size: 723 Bytes

Contents

require 'concurrent/thread_safe/util'

module Concurrent
  module ThreadSafe
    module Util
      def self.make_synchronized_on_rbx(klass)
        klass.class_eval do
          private
          def _mon_initialize
            @_monitor = Monitor.new unless @_monitor # avoid double initialisation
          end

          def self.allocate
            obj = super
            obj.send(:_mon_initialize)
            obj
          end
        end

        klass.superclass.instance_methods(false).each do |method|
          klass.class_eval <<-RUBY, __FILE__, __LINE__ + 1
            def #{method}(*args)
              @_monitor.synchronize { super }
            end
          RUBY
        end
      end
    end
  end
end

Version data entries

89 entries across 83 versions & 22 rubygems

Version Path
logstash-filter-csharp-0.2.1 vendor/bundle/jruby/2.3.0/gems/concurrent-ruby-1.0.0-java/lib/concurrent/thread_safe/util/array_hash_rbx.rb
logstash-filter-csharp-0.2.0 vendor/bundle/jruby/2.3.0/gems/concurrent-ruby-1.0.0-java/lib/concurrent/thread_safe/util/array_hash_rbx.rb
tdiary-5.0.11 vendor/bundle/gems/concurrent-ruby-1.0.5/lib/concurrent/thread_safe/util/array_hash_rbx.rb
sprokovuln-0.2.0 vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/thread_safe/util/array_hash_rbx.rb
logstash-filter-device_detection-1.0.7-java vendor/bundle/jruby/1.9/gems/concurrent-ruby-1.0.5-java/lib/concurrent/thread_safe/util/array_hash_rbx.rb
tdiary-5.0.9 vendor/bundle/gems/concurrent-ruby-1.0.5/lib/concurrent/thread_safe/util/array_hash_rbx.rb
mrcooper-logstash-output-azuresearch-0.2.2 vendor/jruby/2.5.0/gems/concurrent-ruby-1.0.0-java/lib/concurrent/thread_safe/util/array_hash_rbx.rb
monero_wallet_gen-0.1.0 vendor/bundle/ruby/2.3.0/gems/concurrent-ruby-1.0.5/lib/concurrent/thread_safe/util/array_hash_rbx.rb
tdiary-5.0.8 vendor/bundle/gems/concurrent-ruby-1.0.5/lib/concurrent/thread_safe/util/array_hash_rbx.rb
tdiary-5.0.8 vendor/bundle/ruby/2.5.0/gems/concurrent-ruby-1.0.5/lib/concurrent/thread_safe/util/array_hash_rbx.rb
tdiary-5.0.8 vendor/bundle/gems/tdiary-5.0.7/vendor/bundle/gems/concurrent-ruby-1.0.5/lib/concurrent/thread_safe/util/array_hash_rbx.rb
tdiary-5.0.7 vendor/bundle/gems/concurrent-ruby-1.0.5/lib/concurrent/thread_safe/util/array_hash_rbx.rb
pract6-0.1.0 .gem/ruby/2.3.0/gems/concurrent-ruby-1.0.5/lib/concurrent/thread_safe/util/array_hash_rbx.rb
logstash-output-icinga-1.1.0 vendor/jruby/1.9/gems/concurrent-ruby-1.0.0-java/lib/concurrent/thread_safe/util/array_hash_rbx.rb
logstash-output-icinga-1.1.0 vendor/jruby/2.3.0/gems/concurrent-ruby-1.0.0-java/lib/concurrent/thread_safe/util/array_hash_rbx.rb
tdiary-5.0.6 vendor/bundle/gems/concurrent-ruby-1.0.5/lib/concurrent/thread_safe/util/array_hash_rbx.rb
logstash-filter-cache-redis-0.3.1 vendor/bundle/jruby/1.9/gems/concurrent-ruby-1.0.5-java/lib/concurrent/thread_safe/util/array_hash_rbx.rb
logstash-filter-cache-redis-0.3.0 vendor/bundle/jruby/1.9/gems/concurrent-ruby-1.0.5-java/lib/concurrent/thread_safe/util/array_hash_rbx.rb
logstash-filter-cache-redis-0.2.0 vendor/bundle/jruby/1.9/gems/concurrent-ruby-1.0.5-java/lib/concurrent/thread_safe/util/array_hash_rbx.rb
logstash-filter-cache-redis-0.1.0 vendor/bundle/jruby/1.9/gems/concurrent-ruby-1.0.0-java/lib/concurrent/thread_safe/util/array_hash_rbx.rb