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

Method Next

library/cpp/neh/rq.cpp:251–279  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

249 }
250
251 IRequestRef Next() override {
252 while (true) {
253 IRequestRef ret;
254
255 if (Q_.Dequeue(&ret)) {
256 return ret;
257 }
258
259 TLocalQueue* lq = LocalQueue();
260
261 FQ_.Enqueue(lq);
262
263 if (Q_.Dequeue(&ret)) {
264 TLocalQueue* besttry;
265
266 if (FQ_.Dequeue(&besttry)) {
267 if (besttry == lq) {
268 //huraay, get rid of spurious wakeup
269 } else {
270 FQ_.Enqueue(besttry);
271 }
272 }
273
274 return ret;
275 }
276
277 lq->Wait();
278 }
279 }
280
281 private:
282 static inline TLocalQueue* LocalQueue() noexcept {

Callers

nothing calls this directly

Calls 3

DequeueMethod · 0.45
EnqueueMethod · 0.45
WaitMethod · 0.45

Tested by

no test coverage detected