MCPcopy Create free account
hub / github.com/bloomberg/quantum / grabWorkItem

Method grabWorkItem

quantum/impl/quantum_task_queue_impl.h:526–543  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

524}
525
526inline
527TaskQueue::WorkItem
528TaskQueue::grabWorkItem()
529{
530 //========================= LOCKED SCOPE =========================
531 SpinLock::Guard lock(_runQueueLock);
532 if ((_queueIt == _runQueue.end()) || (!_isAdvanced && (++_queueIt == _runQueue.end())))
533 {
534 acquireWaiting();
535 }
536 _isAdvanced = false; //reset flag
537 _isIdle = _runQueue.empty();
538 if (_runQueue.empty())
539 {
540 return WorkItem(nullptr, _runQueue.end(), _isBlocked, _queueRound);
541 }
542 return WorkItem((*_queueIt), _queueIt, false, 0);
543}
544
545inline
546void TaskQueue::onBlockedTask(WorkItem& entry)

Callers

nothing calls this directly

Calls 3

WorkItemClass · 0.85
endMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected