| 467 | } |
| 468 | |
| 469 | bool Dequeue(T& value) { |
| 470 | size_t readPos = GetCycleCount(); |
| 471 | for (size_t i = 0; i < Concurrency; ++i) { |
| 472 | TQueueType& queue = Queues[readPos++ % Concurrency]; |
| 473 | if (queue.ReadLock.IsLocked()) { |
| 474 | continue; |
| 475 | } |
| 476 | TTryGuard guard{queue.ReadLock}; |
| 477 | if (!guard) { |
| 478 | continue; |
| 479 | } |
| 480 | if (queue.Dequeue(value)) { |
| 481 | return true; |
| 482 | } |
| 483 | } |
| 484 | return false; |
| 485 | } |
| 486 | |
| 487 | bool IsEmpty() { |
| 488 | for (size_t i = 0; i < Concurrency; ++i) { |
nothing calls this directly
no test coverage detected