22 if (!pipe)
throw std::ios_base::failure(
"Could not create TokenPipe");
28SignalInterrupt::operator bool()
const
37 if (*
this && !
wait())
return false;
45 std::unique_lock<std::mutex> lk(m_mutex);
52 if (!
m_flag.exchange(
true)) {
66 std::unique_lock<std::mutex> lk(m_mutex);
67 m_cv.wait(lk, [
this] {
return m_flag.load(); });
int TokenWrite(uint8_t token)
Write token to endpoint.
int TokenRead()
Read token from endpoint.
static std::optional< TokenPipe > Make()
Create a new pipe.
std::atomic< bool > m_flag