Synchronization::Object
# File lib/concurrent/edge/lock_free_stack.rb, line 79 def clear while true current_head = head return false if current_head == EMPTY return true if compare_and_set_head current_head, EMPTY end end
# File lib/concurrent/edge/lock_free_stack.rb, line 87 def clear_each(&block) while true current_head = head return self if current_head == EMPTY if compare_and_set_head current_head, EMPTY each current_head, &block return self end end end
# File lib/concurrent/edge/lock_free_stack.rb, line 63 def compare_and_clear(head) compare_and_set_head head, EMPTY end
# File lib/concurrent/edge/lock_free_stack.rb, line 52 def compare_and_pop(head) compare_and_set_head head, head.next_node end
# File lib/concurrent/edge/lock_free_stack.rb, line 37 def compare_and_push(head, value) compare_and_set_head head, Node[value, head] end
# File lib/concurrent/edge/lock_free_stack.rb, line 69 def each(head = nil) return to_enum(:each, head) unless block_given? it = head || peek until it.equal?(EMPTY) yield it.value it = it.next_node end self end
# File lib/concurrent/edge/lock_free_stack.rb, line 33 def empty? head.equal? EMPTY end
# File lib/concurrent/edge/lock_free_stack.rb, line 48 def peek head end
Generated with the Darkfish Rdoc Generator 2.