| 472 | /// cyclic reference to itself through the callback. |
| 473 | template <typename OnComplete, typename Callback = WrapOnComplete<OnComplete>> |
| 474 | void AddCallback(OnComplete on_complete, |
| 475 | CallbackOptions opts = CallbackOptions::Defaults()) const { |
| 476 | // We know impl_ will not be dangling when invoking callbacks because at least one |
| 477 | // thread will be waiting for MarkFinished to return. Thus it's safe to keep a |
| 478 | // weak reference to impl_ here |
| 479 | impl_->AddCallback(Callback{std::move(on_complete)}, opts); |
| 480 | } |
| 481 | |
| 482 | /// \brief Overload of AddCallback that will return false instead of running |
| 483 | /// synchronously |
no test coverage detected