1
#ifndef CROSS_PROCESS_SYNC_H_
2
#define CROSS_PROCESS_SYNC_H_
11
struct CrossProcessSync
13
static const int read_fd = 0;
14
static const int write_fd = 1;
19
throw std::runtime_error(strerror(errno));
22
~CrossProcessSync() noexcept
31
if (!write(fds[write_fd], std::addressof(value), sizeof(value)))
32
throw std::runtime_error(::strerror(errno));
35
void wait_for_signal_ready() const
38
if (!read(fds[read_fd], std::addressof(value), sizeof(value)))
39
throw std::runtime_error(::strerror(errno));
46
#endif // CROSS_PROCESS_SYNC_H_