Add clarifying comment to cancellation handling in rendezvous.cc.

PiperOrigin-RevId: 266939120
This commit is contained in:
Derek Murray 2019-09-03 08:55:14 -07:00 committed by TensorFlower Gardener
parent 993bf65062
commit 3904672376

View File

@ -266,6 +266,9 @@ class LocalRendezvousImpl : public Rendezvous {
Item* item = new Item; Item* item = new Item;
if (cm != nullptr) { if (cm != nullptr) {
// NOTE(mrry): We must wrap `done` with code that deregisters the
// cancellation callback before calling the `done` callback, because the
// cancellation manager may no longer be live after `done` is called.
auto wrapped_done = std::bind( auto wrapped_done = std::bind(
[cm, token](const DoneCallback& done, [cm, token](const DoneCallback& done,
// Begin unbound arguments. // Begin unbound arguments.