12 #ifndef INCLUDE_DISTORTOS_ONCEFLAG_HPP_ 13 #define INCLUDE_DISTORTOS_ONCEFLAG_HPP_ 31 template<
typename Function,
typename... Args>
32 friend void callOnce(
OnceFlag& onceFlag, Function&&
function, Args&&... args);
58 #endif // INCLUDE_DISTORTOS_ONCEFLAG_HPP_ constexpr OnceFlag()
OnceFlag's constructor.
Definition: OnceFlag.hpp:40
friend void callOnce(OnceFlag &onceFlag, Function &&function, Args &&... args)
Executes the callable object exactly once, even if called from multiple threads.
Definition: callOnce.hpp:45
Mutex mutex_
internal mutex used by callOnce()
Definition: OnceFlag.hpp:50
Top-level namespace of distortos project.
Definition: buttons.hpp:33
Mutex is the basic synchronization primitive.
Definition: Mutex.hpp:30
volatile bool done_
tells whether any function was already called for this object (true) or not (false)
Definition: OnceFlag.hpp:53
OnceFlag is a helper class for callOnce().
Definition: OnceFlag.hpp:29