MCPcopy Create free account
hub / github.com/cameron314/concurrentqueue / advance

Method advance

benchmarks/tbb/concurrent_queue.cpp:643–660  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

641}
642
643void concurrent_queue_iterator_base_v3::advance() {
644 __TBB_ASSERT( my_item, "attempt to increment iterator past end of queue" );
645 size_t k = my_rep->head_counter;
646 const concurrent_queue_base& queue = my_rep->my_queue;
647#if TBB_USE_ASSERT
648 void* tmp;
649 my_rep->get_item(tmp,k);
650 __TBB_ASSERT( my_item==tmp, NULL );
651#endif /* TBB_USE_ASSERT */
652 size_t i = modulo_power_of_two( k/concurrent_queue_rep::n_queue, queue.items_per_page );
653 if( i==queue.items_per_page-1 ) {
654 concurrent_queue_base::page*& root = my_rep->array[concurrent_queue_rep::index(k)];
655 root = root->next;
656 }
657 // advance k
658 my_rep->head_counter = ++k;
659 if( !my_rep->get_item(my_item, k) ) advance();
660}
661
662concurrent_queue_iterator_base_v3::~concurrent_queue_iterator_base_v3() {
663 //delete my_rep;

Callers

nothing calls this directly

Calls 2

modulo_power_of_twoFunction · 0.85
get_itemMethod · 0.45

Tested by

no test coverage detected