31 #ifndef _SYS_UTIL_EVENT_H
32 #define _SYS_UTIL_EVENT_H
104 Event(
Event&& other) : m_fd{other.m_fd}, m_flags{other.m_flags}
113 m_flags = other.m_flags;
120 operator int()
const {
return m_fd; }
122 int fd()
const {
return m_fd; }
130 void reset(
int = -1);
145 void write(uint64_t);
Signaling kernel event counter.
uint64_t read()
Read from (decrement) the event counter.
Event(Event &&other)
Move constructor.
void operator=(const Event &)=delete
No copy.
void reset(int=-1)
Reset the event.
int fd() const
Return file descriptor.
const Event & operator=(Event &&other)
Move assignment.
Event(int=0)
Construct an event.
void write(uint64_t)
Write to (increment) the event counter.
@ semaphore
Semaphore mode. Event reads decrement the counter by 1. Otherwise, reads set the counter to 0.
@ nonblocking
Non-blocking mode. If an event is read while unsignalled, throws and exception.
Event(const Event &)=delete
No copy.