Synchronization::Object
We use `Object#hash` as a way to enforce ordering on the nodes. This can be configurable in the future; for example, you could enforce a split-ordering on the nodes in the set.
# File lib/concurrent/edge/lock_free_linked_set/node.rb, line 51 def <=>(other) @Key <=> other.hash end
# File lib/concurrent/edge/lock_free_linked_set/node.rb, line 18 def data @Data end
# File lib/concurrent/edge/lock_free_linked_set/node.rb, line 26 def key @Key end
This method provides a unqiue key for the data which will be used for ordering. This is configurable, and changes depending on how you wish the nodes to be ordered.
# File lib/concurrent/edge/lock_free_linked_set/node.rb, line 44 def key_for(data) data.hash end
Check to see if the node is the last in the list.
# File lib/concurrent/edge/lock_free_linked_set/node.rb, line 31 def last? @SuccessorReference.value.is_a? Tail end
Next node in the list. Note: this is not the AtomicMarkableReference of the next node, this is the actual Node itself.
# File lib/concurrent/edge/lock_free_linked_set/node.rb, line 37 def next_node @SuccessorReference.value end
Generated with the Darkfish Rdoc Generator 2.