cheshirekow
v0.1.0
|
Manages a pipe which can be used as a condition variable between two threads. This is in contrast to a pthreads condition variable which can't be selected
-ed or epoll
-ed.
More...
#include <cpp_nix/notify_pipe.h>
Public Member Functions | |
int | Clear () |
Read from the pipe until it's empty. More... | |
int | GetReadFd () |
Return the file descriptor for the read end of the pipe. More... | |
int | GetWriteFd () |
Return the file descriptor for the write end of the pipe. More... | |
int | Notify () |
Write a single byte to the pipe to signal all listeners. More... | |
NotifyPipe () | |
opens pipe More... | |
~NotifyPipe () | |
closes pipe More... | |
Private Attributes | |
int | m_fd [2] |
Manages a pipe which can be used as a condition variable between two threads. This is in contrast to a pthreads condition variable which can't be selected
-ed or epoll
-ed.
Definition at line 35 of file notify_pipe.h.
nix::NotifyPipe::NotifyPipe | ( | ) |
opens pipe
nix::NotifyPipe::~NotifyPipe | ( | ) |
closes pipe
int nix::NotifyPipe::Clear | ( | ) |
Read from the pipe until it's empty.
int nix::NotifyPipe::GetReadFd | ( | ) |
Return the file descriptor for the read end of the pipe.
int nix::NotifyPipe::GetWriteFd | ( | ) |
Return the file descriptor for the write end of the pipe.
int nix::NotifyPipe::Notify | ( | ) |
Write a single byte to the pipe to signal all listeners.
|
private |
Definition at line 37 of file notify_pipe.h.