FastLED 3.10.6
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 }
fl::function< void(const T &)> mThenCallback
Definition promise.h:350
const T & value() const FL_NO_EXCEPT
Get value (only valid if resolved)
Definition promise.h:336
void process_callbacks() FL_NO_EXCEPT
Process pending callbacks.
Definition promise.h:366
PromiseState_t state() const FL_NO_EXCEPT
Read the state atomically.
Definition promise.h:356
void set_state(PromiseState_t s) FL_NO_EXCEPT
Write the state atomically.
Definition promise.h:361
Implementation class for Promise - holds the actual state and logic.
Definition promise.h:245

References fl::FL_NO_EXCEPT, 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: