2#if !ALIB_SINGLE_THREADED && ALIB_DEBUG && ALIB_STRINGS && !DOXYGEN
7 "Promise was already fulfilled. Repeated calls not allowed.\n"
17 "Promise was already awaited. Repeated calls not allowed.\n"
24 while (
future.wait_for( (waitDuration - waitTimer.Age()).Export() )
25 != std::future_status::ready )
27 if ( waitTimer.Age() < waitDuration )
30 ALIB_WARNING(
"THREADS",
"Waiting for a Promise since {}.", overallTimer.Age() )
40 "Promise was already awaited. Repeated calls not allowed.\n"
43 if (
future.wait_for(maxWaitTimeSpan) == std::future_status::timeout )
52 "Promise was already awaited. Repeated calls not allowed.\n"
55 if (
future.wait_until(wakeUpTime.Export()) == std::future_status::timeout )
#define ALIB_WARNING(domain,...)
#define ALIB_ASSERT_ERROR(cond, domain,...)
void Fulfill(const CallerInfo &ci, State state=State::OK)
lang::CallerInfo DbgFulfillCI
State Wait(const CallerInfo &ci)
lang::CallerInfo DbgWaitCI
Ticks::Duration DbgWaitTimeLimit
@ Unfulfilled
The state after construction.
State WaitUntil(const Ticks &wakeUpTime, const CallerInfo &ci)
std::future< State > future
Used for implementation.
State WaitFor(const Ticks::Duration::TDuration &maxWaitTimeSpan, const CallerInfo &ci)
Promise()
Default constructor.
std::promise< State > promise
Used for implementation.
lang::CallerInfo CallerInfo
Type alias in namespace #"%alib".
time::Ticks Ticks
Type alias in namespace #"%alib".