19 #ifndef PSTORE_OS_SIGNAL_CV_HPP 20 #define PSTORE_OS_SIGNAL_CV_HPP 57 void wait (std::unique_lock<std::mutex> & lock);
71 static void make_non_blocking (
int fd);
72 static int write (
int fd) noexcept;
97 cv_.notify_all_no_except ();
105 void wait (std::unique_lock<std::mutex> & lock) { cv_.wait (lock); }
106 void wait () { cv_.wait (); }
108 pipe_descriptor const & wait_descriptor ()
const noexcept {
return cv_.wait_descriptor (); }
109 void reset () { cv_.reset (); }
111 int signal ()
const {
return signal_.load (); }
114 std::atomic<int> signal_{-1};
120 #endif // PSTORE_OS_SIGNAL_CV_HPP void wait(std::unique_lock< std::mutex > &lock)
Releases lock and blocks the current executing thread.
Definition: signal_cv_posix.cpp:141
void notify_all()
Unblocks all threads currently waiting for *this.
Definition: signal_cv_posix.cpp:91
void notify_all_no_except() noexcept
Unblocks all threads currently waiting for *this.
Definition: signal_cv_posix.cpp:103
Provides a platorm-independent "descriptor" class for accessing pipes and sockets.
void wait(std::unique_lock< std::mutex > &lock)
Releases lock and blocks the current executing thread.
Definition: signal_cv.hpp:105
On POSIX, This class implements the "self pipe trick" to enable a signal handler to call notify() to ...
Definition: signal_cv.hpp:32
DescriptorTraits is a traits structure of the following form:
Definition: descriptor.hpp:59
Definition: nonpod2.cpp:40
void notify_all(int const signal) noexcept
Unblocks all threads currently waiting for *this.
Definition: signal_cv.hpp:95
Definition: signal_cv.hpp:77