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

Function while

benchmarks/tbb/concurrent_priority_queue.h:379–404  ·  view source on GitHub ↗

second pass processes pop operations

Source from the content-addressed store, hash-verified

377
378 // second pass processes pop operations
379 while (pop_list) {
380 tmp = pop_list;
381 pop_list = itt_hide_load_word(pop_list->next);
382 __TBB_ASSERT(tmp->type == POP_OP, NULL);
383 if (data.empty()) {
384 itt_store_word_with_release(tmp->status, uintptr_t(FAILED));
385 }
386 else {
387 __TBB_ASSERT(mark<=data.size(), NULL);
388 if (mark < data.size() &&
389 compare(data[0], data[data.size()-1])) {
390 // there are newly pushed elems and the last one is
391 // higher than top
392 *(tmp->elem) = move(data[data.size()-1]);
393 __TBB_store_with_release(my_size, my_size-1);
394 itt_store_word_with_release(tmp->status, uintptr_t(SUCCEEDED));
395 data.pop_back();
396 }
397 else { // extract top and push last element down heap
398 *(tmp->elem) = move(data[0]);
399 __TBB_store_with_release(my_size, my_size-1);
400 itt_store_word_with_release(tmp->status, uintptr_t(SUCCEEDED));
401 reheap();
402 }
403 }
404 }
405
406 // heapify any leftover pushed elements before doing the next
407 // batch of operations

Callers 4

dequeue_bulkFunction · 0.85
enqueue_bulkFunction · 0.85

Calls 7

itt_hide_load_wordFunction · 0.85
moveFunction · 0.85
__TBB_store_with_releaseFunction · 0.85
emptyMethod · 0.45
sizeMethod · 0.45
pop_backMethod · 0.45

Tested by

no test coverage detected