Synchronization::Object
# File lib/concurrent/edge/lock_free_stack.rb, line 63 def clear while true head = @Head.get return false if head == EMPTY return true if @Head.compare_and_set head, EMPTY end end
# File lib/concurrent/edge/lock_free_stack.rb, line 59 def compare_and_clear(head) @Head.compare_and_set head, EMPTY end
# File lib/concurrent/edge/lock_free_stack.rb, line 48 def compare_and_pop(head) @Head.compare_and_set head, head.next_node end
# File lib/concurrent/edge/lock_free_stack.rb, line 33 def compare_and_push(head, value) @Head.compare_and_set head, Node[value, head] end
# File lib/concurrent/edge/lock_free_stack.rb, line 73 def each return to_enum unless block_given? it = peek until it.equal?(EMPTY) yield it.value it = it.next_node end self end
# File lib/concurrent/edge/lock_free_stack.rb, line 29 def empty? @Head.get.equal? EMPTY end
# File lib/concurrent/edge/lock_free_stack.rb, line 44 def peek @Head.get end
Generated with the Darkfish Rdoc Generator 2.