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

Method WaitForWork

tensorflow/core/framework/run_handler.cc:165–178  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

163 }
164
165 void WaitForWork(int max_sleep_micros) {
166 mutex_lock l(waiters_mu_);
167 Waiter waiter;
168 // Add waiter to the LIFO queue
169 waiter.prev = &queue_waiters_;
170 waiter.next = queue_waiters_.next;
171 waiter.next->prev = &waiter;
172 waiter.prev->next = &waiter;
173 // Wait on the condition variable
174 waiter.cv.wait_for(l, std::chrono::microseconds(max_sleep_micros));
175 // Remove waiter from the LIFO queue
176 waiter.next->prev = waiter.prev;
177 waiter.prev->next = waiter.next;
178 }
179
180 int TaskQueueSize(bool is_blocking) {
181 if (is_blocking) {

Callers

nothing calls this directly

Calls 1

wait_forMethod · 0.80

Tested by

no test coverage detected