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

Method size_approx

concurrentqueue.h:1347–1354  ·  view source on GitHub ↗

Returns an estimate of the total number of elements currently in the queue. This estimate is only accurate if the queue has completely stabilized before it is called (i.e. all enqueue and dequeue operations have completed and their memory effects are visible on the calling thread, and no further operations start while this method is being called). Thread-safe.

Source from the content-addressed store, hash-verified

1345 // being called).
1346 // Thread-safe.
1347 size_t size_approx() const
1348 {
1349 size_t size = 0;
1350 for (auto ptr = producerListTail.load(std::memory_order_acquire); ptr != nullptr; ptr = ptr->next_prod()) {
1351 size += ptr->size_approx();
1352 }
1353 return size;
1354 }
1355
1356
1357 // Returns true if the underlying atomic variables used by

Callers

nothing calls this directly

Calls 3

next_prodMethod · 0.80
loadMethod · 0.45
size_approxMethod · 0.45

Tested by

no test coverage detected