MCPcopy Create free account
hub / github.com/catboost/catboost / Dequeue

Method Dequeue

library/cpp/threading/chunk_queue/queue.h:469–485  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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) {

Callers

nothing calls this directly

Calls 3

GetCycleCountFunction · 0.85
IsLockedMethod · 0.45
DequeueMethod · 0.45

Tested by

no test coverage detected