| 69 | } |
| 70 | |
| 71 | bool TryAddCallback(const std::function<Callback()>& callback_factory, |
| 72 | CallbackOptions opts) { |
| 73 | CheckOptions(opts); |
| 74 | std::unique_lock<std::mutex> lock(mutex_); |
| 75 | if (IsFutureFinished(state_)) { |
| 76 | return false; |
| 77 | } else { |
| 78 | callbacks_.push_back({callback_factory(), opts}); |
| 79 | return true; |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | static bool ShouldScheduleCallback(const CallbackRecord& callback_record, |
| 84 | bool in_add_callback) { |
nothing calls this directly
no test coverage detected