| 485 | } |
| 486 | |
| 487 | bool IsEmpty() { |
| 488 | for (size_t i = 0; i < Concurrency; ++i) { |
| 489 | TQueueType& queue = Queues[i]; |
| 490 | if (queue.ReadLock.IsLocked()) { |
| 491 | continue; |
| 492 | } |
| 493 | TTryGuard guard{queue.ReadLock}; |
| 494 | if (!guard) { |
| 495 | continue; |
| 496 | } |
| 497 | if (!queue.IsEmpty()) { |
| 498 | return false; |
| 499 | } |
| 500 | } |
| 501 | return true; |
| 502 | } |
| 503 | |
| 504 | private: |
| 505 | template <typename TT> |