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

Method DeregisterCallback

tensorflow/core/framework/cancellation.cc:72–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70}
71
72bool CancellationManager::DeregisterCallback(CancellationToken token) {
73 mu_.lock();
74 if (is_cancelled_) {
75 mu_.unlock();
76 return false;
77 } else if (is_cancelling_) {
78 mu_.unlock();
79 // Wait for all of the cancellation callbacks to be called. This
80 // wait ensures that the caller of DeregisterCallback does not
81 // return immediately and free objects that may be used in the
82 // execution of any currently pending callbacks in StartCancel.
83 cancelled_notification_.WaitForNotification();
84 return false;
85 } else {
86 callbacks_.erase(token);
87 mu_.unlock();
88 return true;
89 }
90}
91
92bool CancellationManager::TryDeregisterCallback(CancellationToken token) {
93 mutex_lock lock(mu_);

Callers 13

StarRunGraphAsyncMethod · 0.80
TESTFunction · 0.80
RunInternalMethod · 0.80
FlushUnlockedMethod · 0.80
AcquireAsyncMethod · 0.80
FlushUnlockedMethod · 0.80
ComputeAsyncMethod · 0.80
StartMethod · 0.80
DoRunGraphMethod · 0.80
DoPartialRunGraphMethod · 0.80
RunPartitionsHelperMethod · 0.80

Calls 4

lockMethod · 0.45
unlockMethod · 0.45
WaitForNotificationMethod · 0.45
eraseMethod · 0.45

Tested by 1

TESTFunction · 0.64