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.
| 1302 | // being called). |
| 1303 | // Thread-safe. |
| 1304 | size_t size_approx() const |
| 1305 | { |
| 1306 | size_t size = 0; |
| 1307 | for (auto ptr = producerListTail.load(std::memory_order_acquire); ptr != nullptr; ptr = ptr->next_prod()) { |
| 1308 | size += ptr->size_approx(); |
| 1309 | } |
| 1310 | return size; |
| 1311 | } |
| 1312 | |
| 1313 | |
| 1314 | // Returns true if the underlying atomic variables used by |
nothing calls this directly
no test coverage detected