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()#

Construct a new event semaphore.

inline bool occurred()#

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()#

Reset the event.

Private Types

typedef hpx::spinlock mutex_type#

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_#