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

Method RegisterCallback

tensorflow/core/framework/cancellation.cc:61–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59}
60
61bool CancellationManager::RegisterCallback(CancellationToken token,
62 CancelCallback callback) {
63 mutex_lock l(mu_);
64 CHECK_LT(token, next_cancellation_token_) << "Invalid cancellation token";
65 bool should_register = !is_cancelled_ && !is_cancelling_;
66 if (should_register) {
67 std::swap(callbacks_[token], callback);
68 }
69 return should_register;
70}
71
72bool CancellationManager::DeregisterCallback(CancellationToken token) {
73 mu_.lock();

Callers 15

StarRunGraphAsyncMethod · 0.45
ComputeMethod · 0.45
RecvAsyncMethod · 0.45
TESTFunction · 0.45
RunInternalMethod · 0.45
AcquireAsyncMethod · 0.45
TryDequeueManyMethod · 0.45
TryTakeGradMethod · 0.45
TryEnqueueMethod · 0.45
TryEnqueueManyMethod · 0.45
TryDequeueMethod · 0.45
TryDequeueManyMethod · 0.45

Calls

no outgoing calls

Tested by 1

TESTFunction · 0.36