FastLED 3.9.15
Loading...
Searching...
No Matches

◆ resolve() [1/2]

template<typename T>
bool fl::task::detail::PromiseImpl< T >::resolve ( const T & value)
inline

Resolve Promise with value.

Definition at line 276 of file promise.h.

276 {
277 if (state() != PromiseState_t::PENDING) return false;
278
279 // Write value BEFORE setting state — the atomic store provides
280 // a release fence so the reader sees the value after observing
281 // the state transition.
282 mValue = value;
284
285 // Process callback immediately if we have one
288 }
289
290 return true;
291 }
const T & value() const FL_NOEXCEPT
Get value (only valid if resolved)
Definition promise.h:336
void process_callbacks() FL_NOEXCEPT
Process pending callbacks.
Definition promise.h:366
void set_state(PromiseState_t s) FL_NOEXCEPT
Write the state atomically.
Definition promise.h:361
fl::function< void(const T &)> mThenCallback
Definition promise.h:350
PromiseState_t state() const FL_NOEXCEPT
Read the state atomically.
Definition promise.h:356
Implementation class for Promise - holds the actual state and logic.
Definition promise.h:245

References FL_NOEXCEPT, mCallbacksProcessed, mThenCallback, mValue, fl::task::detail::PENDING, process_callbacks(), fl::task::detail::RESOLVED, set_state(), state(), and value().

+ Here is the call graph for this function: