Sha256: 52e4f0ac2b3e790335849fdf04a2cb8a501d4625064b1ad3a3b0e07677cc47b2

Contents?: true

Size: 1.45 KB

Versions: 89

Compression:

Stored size: 1.45 KB

Contents

module Concurrent
  module Synchronization

    # @!visibility private
    # @!macro internal_implementation_note
    class MriLockableObject < AbstractLockableObject
      protected

      def ns_signal
        @__condition__.signal
        self
      end

      def ns_broadcast
        @__condition__.broadcast
        self
      end
    end


    # @!visibility private
    # @!macro internal_implementation_note
    class MriMutexLockableObject < MriLockableObject
      safe_initialization!

      def initialize(*defaults)
        super(*defaults)
        @__lock__      = ::Mutex.new
        @__condition__ = ::ConditionVariable.new
      end

      protected

      def synchronize
        if @__lock__.owned?
          yield
        else
          @__lock__.synchronize { yield }
        end
      end

      def ns_wait(timeout = nil)
        @__condition__.wait @__lock__, timeout
        self
      end
    end

    # @!visibility private
    # @!macro internal_implementation_note
    class MriMonitorLockableObject < MriLockableObject
      safe_initialization!

      def initialize(*defaults)
        super(*defaults)
        @__lock__      = ::Monitor.new
        @__condition__ = @__lock__.new_cond
      end

      protected

      def synchronize # TODO may be a problem with lock.synchronize { lock.wait }
        @__lock__.synchronize { yield }
      end

      def ns_wait(timeout = nil)
        @__condition__.wait timeout
        self
      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/synchronization/mri_lockable_object.rb
logstash-filter-csharp-0.2.0 vendor/bundle/jruby/2.3.0/gems/concurrent-ruby-1.0.0-java/lib/concurrent/synchronization/mri_lockable_object.rb
tdiary-5.0.11 vendor/bundle/gems/concurrent-ruby-1.0.5/lib/concurrent/synchronization/mri_lockable_object.rb
sprokovuln-0.2.0 vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/synchronization/mri_lockable_object.rb
logstash-filter-device_detection-1.0.7-java vendor/bundle/jruby/1.9/gems/concurrent-ruby-1.0.5-java/lib/concurrent/synchronization/mri_lockable_object.rb
tdiary-5.0.9 vendor/bundle/gems/concurrent-ruby-1.0.5/lib/concurrent/synchronization/mri_lockable_object.rb
mrcooper-logstash-output-azuresearch-0.2.2 vendor/jruby/2.5.0/gems/concurrent-ruby-1.0.0-java/lib/concurrent/synchronization/mri_lockable_object.rb
monero_wallet_gen-0.1.0 vendor/bundle/ruby/2.3.0/gems/concurrent-ruby-1.0.5/lib/concurrent/synchronization/mri_lockable_object.rb
tdiary-5.0.8 vendor/bundle/gems/concurrent-ruby-1.0.5/lib/concurrent/synchronization/mri_lockable_object.rb
tdiary-5.0.8 vendor/bundle/ruby/2.5.0/gems/concurrent-ruby-1.0.5/lib/concurrent/synchronization/mri_lockable_object.rb
tdiary-5.0.8 vendor/bundle/gems/tdiary-5.0.7/vendor/bundle/gems/concurrent-ruby-1.0.5/lib/concurrent/synchronization/mri_lockable_object.rb
tdiary-5.0.7 vendor/bundle/gems/concurrent-ruby-1.0.5/lib/concurrent/synchronization/mri_lockable_object.rb
pract6-0.1.0 .gem/ruby/2.3.0/gems/concurrent-ruby-1.0.5/lib/concurrent/synchronization/mri_lockable_object.rb
logstash-output-icinga-1.1.0 vendor/jruby/1.9/gems/concurrent-ruby-1.0.0-java/lib/concurrent/synchronization/mri_lockable_object.rb
logstash-output-icinga-1.1.0 vendor/jruby/2.3.0/gems/concurrent-ruby-1.0.0-java/lib/concurrent/synchronization/mri_lockable_object.rb
tdiary-5.0.6 vendor/bundle/gems/concurrent-ruby-1.0.5/lib/concurrent/synchronization/mri_lockable_object.rb
logstash-filter-cache-redis-0.3.1 vendor/bundle/jruby/1.9/gems/concurrent-ruby-1.0.5-java/lib/concurrent/synchronization/mri_lockable_object.rb
logstash-filter-cache-redis-0.3.0 vendor/bundle/jruby/1.9/gems/concurrent-ruby-1.0.5-java/lib/concurrent/synchronization/mri_lockable_object.rb
logstash-filter-cache-redis-0.2.0 vendor/bundle/jruby/1.9/gems/concurrent-ruby-1.0.5-java/lib/concurrent/synchronization/mri_lockable_object.rb
logstash-filter-cache-redis-0.1.0 vendor/bundle/jruby/1.9/gems/concurrent-ruby-1.0.0-java/lib/concurrent/synchronization/mri_lockable_object.rb