YACLib
C++ library for concurrent tasks execution
|
Waiter is public for advanced users. More...
#include <one_shot_event.hpp>
Public Member Functions | |
void | Call () noexcept final |
Public Member Functions inherited from yaclib::Job | |
virtual void | Drop () noexcept |
Public Member Functions inherited from yaclib::IRef | |
virtual void | IncRef () noexcept |
Increments reference counter. | |
virtual void | DecRef () noexcept |
Decrements reference counter. | |
virtual | ~IRef () noexcept=default |
Public Member Functions inherited from yaclib::detail::MutexEvent | |
Token | Make () noexcept |
void | Wait (Token &token) noexcept |
template<typename Rep , typename Period > | |
bool | Wait (Token &token, const std::chrono::duration< Rep, Period > &timeout_duration) noexcept |
template<typename Clock , typename Duration > | |
bool | Wait (Token &token, const std::chrono::time_point< Clock, Duration > &timeout_time) noexcept |
void | Set () noexcept |
void | Reset () noexcept |
Additional Inherited Members | |
Public Types inherited from yaclib::detail::MutexEvent | |
using | Token = std::unique_lock< yaclib_std::mutex > |
Public Attributes inherited from yaclib::detail::Node | |
Node * | next = nullptr |
Waiter is public for advanced users.
Sometimes we don't want to recreate Waiter on every Wait call (it's created on stack).
So we make Waiter public for such users, and they can write code like:
Waiter _waiter; OneShotEvent _event; // code like OneShotEvent::Wait() but with our own _waiter _event.Set(); // code like OneShotEvent::Wait() but with our own _waiter
Definition at line 216 of file one_shot_event.hpp.
|
inlinefinalvirtualnoexcept |
Reimplemented from yaclib::IFunc.
Definition at line 217 of file one_shot_event.hpp.
References yaclib::OneShotEvent::Set().