Sha256: c92e34b8c796fc89131401fa4a276556bcadc56443dba6bcace842e6c9b75b97

Contents?: true

Size: 1.31 KB

Versions: 13

Compression:

Stored size: 1.31 KB

Contents

module ThreadSafe
  class SynchronizedCacheBackend < NonConcurrentCacheBackend
    require 'mutex_m'
    include Mutex_m
    # WARNING: Mutex_m is a non-reentrant lock, so the synchronized methods are not allowed to call each other.

    def [](key)
      synchronize { super }
    end

    def []=(key, value)
      synchronize { super }
    end

    def compute_if_absent(key)
      synchronize { super }
    end

    def compute_if_present(key)
      synchronize { super }
    end

    def compute(key)
      synchronize { super }
    end

    def merge_pair(key, value)
      synchronize { super }
    end

    def replace_pair(key, old_value, new_value)
      synchronize { super }
    end

    def replace_if_exists(key, new_value)
      synchronize { super }
    end

    def get_and_set(key, value)
      synchronize { super }
    end

    def key?(key)
      synchronize { super }
    end

    def value?(value)
      synchronize { super }
    end

    def delete(key)
      synchronize { super }
    end

    def delete_pair(key, value)
      synchronize { super }
    end

    def clear
      synchronize { super }
    end

    def size
      synchronize { super }
    end

    def get_or_default(key, default_value)
      synchronize { super }
    end

    private
    def dupped_backend
      synchronize { super }
    end
  end
end

Version data entries

13 entries across 13 versions & 3 rubygems

Version Path
nanumfont-rails-0.1 vendor/bundle/ruby/2.1.0/gems/thread_safe-0.3.4/lib/thread_safe/synchronized_cache_backend.rb
whos_dated_who-0.1.0 vendor/bundle/gems/thread_safe-0.3.4/lib/thread_safe/synchronized_cache_backend.rb
whos_dated_who-0.0.1 vendor/bundle/gems/thread_safe-0.3.4/lib/thread_safe/synchronized_cache_backend.rb
thread_safe-0.3.4 lib/thread_safe/synchronized_cache_backend.rb
thread_safe-0.3.4-java lib/thread_safe/synchronized_cache_backend.rb
thread_safe-0.3.3-java lib/thread_safe/synchronized_cache_backend.rb
thread_safe-0.3.3 lib/thread_safe/synchronized_cache_backend.rb
thread_safe-0.3.2-java lib/thread_safe/synchronized_cache_backend.rb
thread_safe-0.3.2 lib/thread_safe/synchronized_cache_backend.rb
thread_safe-0.3.1 lib/thread_safe/synchronized_cache_backend.rb
thread_safe-0.3.1-java lib/thread_safe/synchronized_cache_backend.rb
thread_safe-0.2.0-java lib/thread_safe/synchronized_cache_backend.rb
thread_safe-0.2.0 lib/thread_safe/synchronized_cache_backend.rb