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

Method FlushUnlocked

tensorflow/core/kernels/queue_base.cc:314–335  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

312}
313
314void QueueBase::FlushUnlocked() {
315 std::vector<CleanUp> clean_up;
316 Ref();
317 {
318 mutex_lock lock(mu_);
319 bool changed;
320 do {
321 changed = TryAttemptLocked(kEnqueue, &clean_up);
322 changed = TryAttemptLocked(kDequeue, &clean_up) || changed;
323 } while (changed);
324 }
325 Unref();
326 for (const auto& to_clean : clean_up) {
327 if (to_clean.to_deregister != CancellationManager::kInvalidToken) {
328 // NOTE(mrry): We can safely ignore the return value of
329 // DeregisterCallback because the mutex mu_ ensures that the
330 // cleanup action only executes once.
331 to_clean.cm->DeregisterCallback(to_clean.to_deregister);
332 }
333 to_clean.finished();
334 }
335}
336
337Status QueueBase::CopySliceToElement(const Tensor& parent, Tensor* element,
338 int64 index) {

Callers

nothing calls this directly

Calls 2

DeregisterCallbackMethod · 0.80
finishedMethod · 0.80

Tested by

no test coverage detected