You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: lock_free_stack.rb
    path of file: ./repos/concurrent-ruby/lib/concurrent-ruby/concurrent/collection
    
    the code of the file until where you have to start completion: require 'concurrent/synchronization/object'

module Concurrent

  # @!macro war
    
    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