hpx/synchronization/event.hpp#

Defined in header hpx/synchronization/event.hpp.

See Public API for a list of names and headers that are part of the public HPX API.

namespace hpx
namespace lcos
namespace local
class event#
#include <event.hpp>

Event semaphores can be used for synchronizing multiple threads that need to wait for an event to occur. When the event occurs, all threads waiting for the event are woken up.

Public Functions

inline event() noexcept#

Construct a new event semaphore.

inline bool occurred() const noexcept#

Check if the event has occurred.

inline void wait()#

Wait for the event to occur.

inline void set()#

Release all threads waiting on this semaphore.

inline void reset() noexcept#

Reset the event.

Private Types

using mutex_type = hpx::spinlock#

Private Functions

inline void wait_locked(std::unique_lock<mutex_type> &l)#
inline void set_locked(std::unique_lock<mutex_type> l)#

Private Members

mutex_type mtx_#

This mutex protects the queue.

local::detail::condition_variable cond_#
std::atomic<bool> event_#