Пример #1
0
	concurrent_queue() {
		counted_node_ptr new_counted_node{ 1, allocate_node() };

		head.store(new_counted_node);
		tail.store(new_counted_node);

		assert(head.is_lock_free() && "head/tail not lock free!");
		assert(new_counted_node.get()->count.is_lock_free() && "count not lock free!");
		assert(new_counted_node.get()->next.is_lock_free() && "next not lock free!");
	}
Пример #2
0
 /**
  * \return true, if implementation is lock-free.
  *
  * */
 bool is_lock_free(void) const
 {
     return write_index_.is_lock_free() && read_index_.is_lock_free();
 }