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

Method Close

tensorflow/core/kernels/queue_base.cc:240–262  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

238}
239
240void QueueBase::Close(OpKernelContext* ctx, bool cancel_pending_enqueues,
241 DoneCallback callback) {
242 if (cancel_pending_enqueues) {
243 CloseAndCancel();
244 callback();
245 } else {
246 {
247 mutex_lock lock(mu_);
248 enqueue_attempts_.emplace_back(
249 0, callback, ctx, nullptr, CancellationManager::kInvalidToken,
250 [this](Attempt* attempt) EXCLUSIVE_LOCKS_REQUIRED(mu_) {
251 if (closed_) {
252 attempt->context->SetStatus(
253 errors::Cancelled("Queue '", name_, "' is already closed."));
254 } else {
255 closed_ = true;
256 }
257 return kComplete;
258 });
259 }
260 FlushUnlocked();
261 }
262}
263
264bool QueueBase::TryAttemptLocked(Action action,
265 std::vector<CleanUp>* clean_up) {

Callers 9

CreateTempFileFunction · 0.45
ComputeWithTensorBufMethod · 0.45
WriteDoubleVectorToFileFunction · 0.45
WriteFloatVectorToFileFunction · 0.45
WriteDoubleArrayToFileFunction · 0.45
WriteFloatArrayToFileFunction · 0.45
ComputeAsyncMethod · 0.45
AppendStringToFileFunction · 0.45

Calls 5

callbackFunction · 0.85
CancelledFunction · 0.85
EXCLUSIVE_LOCKS_REQUIREDFunction · 0.50
emplace_backMethod · 0.45
SetStatusMethod · 0.45

Tested by 6

CreateTempFileFunction · 0.36
WriteDoubleVectorToFileFunction · 0.36
WriteFloatVectorToFileFunction · 0.36
WriteDoubleArrayToFileFunction · 0.36
WriteFloatArrayToFileFunction · 0.36