File tree Expand file tree Collapse file tree
libs/internal/include/launchdarkly/async Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -133,6 +133,8 @@ class PromiseInternal {
133133 // Call continuations outside the lock so that continuations which
134134 // re-enter this future (e.g. via GetResult or Then) don't deadlock.
135135 for (auto & continuation : to_call) {
136+ // It's safe to access result_ outside the lock here, because it
137+ // can't be changed again.
136138 continuation (*result_);
137139 }
138140
@@ -355,10 +357,10 @@ class Future {
355357 };
356358 auto state = std::make_shared<State>();
357359
358- // The continuation ignores T entirely (returning a dummy int). The
359- // executor signals the cv when called, since being called means the
360- // original future has resolved.
361- Then ([](T const &) { return 0 ; },
360+ // The continuation ignores T entirely. The executor signals the cv
361+ // when called, since being called means the original future has
362+ // resolved.
363+ Then ([](T const &) { return std::monostate{} ; },
362364 [state](Continuation<void ()> work) {
363365 {
364366 std::lock_guard<std::mutex> lock (state->mutex );
You can’t perform that action at this time.
0 commit comments