| 641 | } |
| 642 | |
| 643 | void 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 | |
| 662 | concurrent_queue_iterator_base_v3::~concurrent_queue_iterator_base_v3() { |
| 663 | //delete my_rep; |
nothing calls this directly
no test coverage detected