openMSX
|
Polls for events on a given file descriptor. More...
#include <Poller.hh>
Public Member Functions | |
Poller () | |
Poller (const Poller &)=delete | |
Poller (Poller &&)=delete | |
Poller & | operator= (const Poller &)=delete |
Poller & | operator= (Poller &&)=delete |
~Poller () | |
bool | poll (int fd) |
Waits for an event to occur on the given file descriptor. | |
bool | aborted () const |
Returns true iff abort() was called. | |
void | abort () |
Aborts a poll in progress and any future poll attempts. | |
void | reset () |
Reset aborted() to false. | |
Polls for events on a given file descriptor.
It is possible to abort this poll from another thread. This class exists because in POSIX there is no straightforward way to abort a blocking I/O operation.
|
delete |
|
delete |
void openmsx::Poller::abort | ( | ) |
Aborts a poll in progress and any future poll attempts.
Definition at line 30 of file Poller.cc.
Referenced by openmsx::CliConnection::end(), openmsx::SocketConnection::output(), openmsx::MidiInReader::unplugHelper(), openmsx::RS232Net::unplugHelper(), and openmsx::RS232Tester::unplugHelper().
|
inline |
bool openmsx::Poller::poll | ( | int | fd | ) |
|
inline |
Reset aborted() to false.
(Functionally the same, but more efficient than destroying and recreating this object).
Definition at line 43 of file Poller.hh.
Referenced by openmsx::MidiInReader::plugHelper(), openmsx::RS232Net::plugHelper(), and openmsx::RS232Tester::plugHelper().