class Concurrent::Collection::AtomicReferenceMapBackend::Table
@!visibility private
Public Instance Methods
Source
# File lib/concurrent-ruby/concurrent/collection/map/atomic_reference_map_backend.rb, line 198 def cas_new_node(i, hash, key, value) cas(i, nil, Node.new(hash, key, value)) end
Source
# File lib/concurrent-ruby/concurrent/collection/map/atomic_reference_map_backend.rb, line 228 def delete_node_at(i, node, predecessor_node) if predecessor_node predecessor_node.next = node.next else volatile_set(i, node.next) end end
Source
# File lib/concurrent-ruby/concurrent/collection/map/atomic_reference_map_backend.rb, line 222 def try_lock_via_hash(i, node, node_hash) node.try_lock_via_hash(node_hash) do yield if volatile_get(i) == node end end
Source
# File lib/concurrent-ruby/concurrent/collection/map/atomic_reference_map_backend.rb, line 202 def try_to_cas_in_computed(i, hash, key) succeeded = false new_value = nil new_node = Node.new(locked_hash = hash | LOCKED, key, NULL) if cas(i, nil, new_node) begin if NULL == (new_value = yield(NULL)) was_null = true else new_node.value = new_value end succeeded = true ensure volatile_set(i, nil) if !succeeded || was_null new_node.unlock_via_hash(locked_hash, hash) end end return succeeded, new_value end