| 1568 | |
| 1569 | template<InnerQueueContext context> |
| 1570 | inline bool is_empty() const |
| 1571 | { |
| 1572 | MOODYCAMEL_CONSTEXPR_IF (context == explicit_context && BLOCK_SIZE <= EXPLICIT_BLOCK_EMPTY_COUNTER_THRESHOLD) { |
| 1573 | // Check flags |
| 1574 | for (size_t i = 0; i < BLOCK_SIZE; ++i) { |
| 1575 | if (!emptyFlags[i].load(std::memory_order_relaxed)) { |
| 1576 | return false; |
| 1577 | } |
| 1578 | } |
| 1579 | |
| 1580 | // Aha, empty; make sure we have all other memory effects that happened before the empty flags were set |
| 1581 | std::atomic_thread_fence(std::memory_order_acquire); |
| 1582 | return true; |
| 1583 | } |
| 1584 | else { |
| 1585 | // Check counter |
| 1586 | if (elementsCompletelyDequeued.load(std::memory_order_relaxed) == BLOCK_SIZE) { |
| 1587 | std::atomic_thread_fence(std::memory_order_acquire); |
| 1588 | return true; |
| 1589 | } |
| 1590 | assert(elementsCompletelyDequeued.load(std::memory_order_relaxed) <= BLOCK_SIZE); |
| 1591 | return false; |
| 1592 | } |
nothing calls this directly
no test coverage detected