carb::tasking::CounterWrapper¶
Defined in carb/tasking/TaskingUtils.h
-
class
carb::tasking
::
CounterWrapper
¶ Wrapper for a carb::tasking::Counter.
Public Functions
-
inline
CounterWrapper
(uint32_t target = 0)¶ Constructs a new CounterWrapper.
- Parameters
target – An optional (default:0) target value for the Counter to become signaled.
-
inline
CounterWrapper
(ITasking *tasking, uint32_t target = 0)¶ Constructs a new CounterWrapper.
Note
Deprecated: The ITasking* parameter is no longer needed in this call.
-
inline
~CounterWrapper
()¶ Destrutor.
Warning
Destroying a Counter that is not signaled will assert in debug builds.
-
inline void
wait
() const¶ Blocks the current thread or task in a fiber-safe way until the Counter becomes signaled.
-
template<class
Rep
, classPeriod
>
inline boolwait_for
(const std::chrono::duration<Rep, Period> &dur) const¶ Blocks the current thread or task in a fiber-safe way until the Counter becomes signaled or a period of time has elapsed.
- Parameters
dur – The amount of time to wait for.
- Returns
true if the Counter is signaled; false if the time period elapsed.
-
template<class
Clock
, classDuration
>
inline boolwait_until
(const std::chrono::time_point<Clock, Duration> &tp) const¶ Blocks the current thread or task in a fiber-safe way until the Counter becomes signaled or the clock reaches the given time point.
- Parameters
tp – The time point to wait until.
- Returns
true if the Counter is signaled; false if the clock time is reached.
-
inline
operator Counter*
() const¶ Convertible to Counter*.
-
inline ITasking *
getTasking
() const¶ Returns the acquired ITasking interface that was used to construct this object.
Note
Deprecated: Use carb::getCachedInterface instead.
-
inline