Class: Concurrent::Collection::SynchronizedMapBackend
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
NonConcurrentMapBackend
|
|
Instance Chain:
self,
NonConcurrentMapBackend
|
|
Inherits: |
Concurrent::Collection::NonConcurrentMapBackend
|
Defined in: | lib/concurrent-ruby/concurrent/collection/map/synchronized_map_backend.rb |
Class Method Summary
- .new(*args, &block) ⇒ SynchronizedMapBackend constructor
NonConcurrentMapBackend
- Inherited
.new | WARNING: all public methods of the class must operate on the @backend directly without calling each other. |
Instance Method Summary
- #[](key)
- #[]=(key, value)
- #clear
- #compute(key)
- #compute_if_absent(key)
- #compute_if_present(key)
- #delete(key)
- #delete_pair(key, value)
- #get_and_set(key, value)
- #get_or_default(key, default_value)
- #key?(key) ⇒ Boolean
- #merge_pair(key, value)
- #replace_if_exists(key, new_value)
- #replace_pair(key, old_value, new_value)
- #size
- #dupped_backend private
NonConcurrentMapBackend
- Inherited
Constructor Details
.new(*args, &block) ⇒ SynchronizedMapBackend
# File 'lib/concurrent-ruby/concurrent/collection/map/synchronized_map_backend.rb', line 11
def initialize(*args, &block) super # WARNING: Mutex is a non-reentrant lock, so the synchronized methods are # not allowed to call each other. @mutex = Mutex.new end
Instance Method Details
#[](key)
[ GitHub ]# File 'lib/concurrent-ruby/concurrent/collection/map/synchronized_map_backend.rb', line 19
def [](key) @mutex.synchronize { super } end
#[]=(key, value)
[ GitHub ]# File 'lib/concurrent-ruby/concurrent/collection/map/synchronized_map_backend.rb', line 23
def []=(key, value) @mutex.synchronize { super } end
#clear
[ GitHub ]# File 'lib/concurrent-ruby/concurrent/collection/map/synchronized_map_backend.rb', line 67
def clear @mutex.synchronize { super } end
#compute(key)
[ GitHub ]# File 'lib/concurrent-ruby/concurrent/collection/map/synchronized_map_backend.rb', line 35
def compute(key) @mutex.synchronize { super } end
#compute_if_absent(key)
[ GitHub ]# File 'lib/concurrent-ruby/concurrent/collection/map/synchronized_map_backend.rb', line 27
def compute_if_absent(key) @mutex.synchronize { super } end
#compute_if_present(key)
[ GitHub ]# File 'lib/concurrent-ruby/concurrent/collection/map/synchronized_map_backend.rb', line 31
def compute_if_present(key) @mutex.synchronize { super } end
#delete(key)
[ GitHub ]# File 'lib/concurrent-ruby/concurrent/collection/map/synchronized_map_backend.rb', line 59
def delete(key) @mutex.synchronize { super } end
#delete_pair(key, value)
[ GitHub ]# File 'lib/concurrent-ruby/concurrent/collection/map/synchronized_map_backend.rb', line 63
def delete_pair(key, value) @mutex.synchronize { super } end
#dupped_backend (private)
[ GitHub ]# File 'lib/concurrent-ruby/concurrent/collection/map/synchronized_map_backend.rb', line 80
def dupped_backend @mutex.synchronize { super } end
#get_and_set(key, value)
[ GitHub ]# File 'lib/concurrent-ruby/concurrent/collection/map/synchronized_map_backend.rb', line 51
def get_and_set(key, value) @mutex.synchronize { super } end
#get_or_default(key, default_value)
[ GitHub ]# File 'lib/concurrent-ruby/concurrent/collection/map/synchronized_map_backend.rb', line 75
def get_or_default(key, default_value) @mutex.synchronize { super } end
#key?(key) ⇒ Boolean
# File 'lib/concurrent-ruby/concurrent/collection/map/synchronized_map_backend.rb', line 55
def key?(key) @mutex.synchronize { super } end
#merge_pair(key, value)
[ GitHub ]# File 'lib/concurrent-ruby/concurrent/collection/map/synchronized_map_backend.rb', line 39
def merge_pair(key, value) @mutex.synchronize { super } end
#replace_if_exists(key, new_value)
[ GitHub ]# File 'lib/concurrent-ruby/concurrent/collection/map/synchronized_map_backend.rb', line 47
def replace_if_exists(key, new_value) @mutex.synchronize { super } end
#replace_pair(key, old_value, new_value)
[ GitHub ]# File 'lib/concurrent-ruby/concurrent/collection/map/synchronized_map_backend.rb', line 43
def replace_pair(key, old_value, new_value) @mutex.synchronize { super } end
#size
[ GitHub ]# File 'lib/concurrent-ruby/concurrent/collection/map/synchronized_map_backend.rb', line 71
def size @mutex.synchronize { super } end