- // Waits until there is activity of the given type on <fd> (or an error),
- // or until a wakeup. Returns true if there was actually activity on
- // the file descriptor.
- //
- // If fd is -1, wait until a wakeup or timeout.
- // if timeout_ts is NULL, there is no timeout.
- bool wait_for_activity(int fd, short events, const timespec *timeout_ts);
-
- // Wait until a wakeup.
- void wait_for_wakeup(const timespec *timeout_ts) { wait_for_activity(-1, 0, timeout_ts); }
-
- // Make wait_for_activity() return.
- void wakeup();