MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / WorkLoop

Method WorkLoop

tensorflow/compiler/xla/python/worker_thread.cc:38–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36bool WorkerThread::WorkAvailable() { return !work_queue_.empty(); }
37
38void WorkerThread::WorkLoop() {
39 while (true) {
40 std::function<void()> fn;
41 {
42 absl::MutexLock lock(&mu_);
43 mu_.Await(absl::Condition(this, &WorkerThread::WorkAvailable));
44 fn = std::move(work_queue_.front());
45 work_queue_.pop();
46 }
47 if (!fn) {
48 return;
49 }
50 fn();
51 }
52}
53
54} // namespace xla

Callers

nothing calls this directly

Calls 5

ConditionClass · 0.85
fnFunction · 0.50
AwaitMethod · 0.45
frontMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected