| 486 | /// cyclic reference to itself through the callback. |
| 487 | template <typename OnComplete, typename Callback = WrapOnComplete<OnComplete>> |
| 488 | void AddCallback(OnComplete on_complete, |
| 489 | CallbackOptions opts = CallbackOptions::Defaults()) const { |
| 490 | // We know impl_ will not be dangling when invoking callbacks because at least one |
| 491 | // thread will be waiting for MarkFinished to return. Thus it's safe to keep a |
| 492 | // weak reference to impl_ here |
| 493 | impl_->AddCallback(Callback{std::move(on_complete)}, opts); |
| 494 | } |
| 495 | |
| 496 | /// \brief Overload of AddCallback that will return false instead of running |
| 497 | /// synchronously |
no test coverage detected