libzypp 17.37.17
|
#include <zypp-core/zyppng/thread/wakeup.h>
Public Member Functions | |
Wakeup () | |
~Wakeup () | |
void | notify () |
void | ack () |
int | pollfd () const |
std::shared_ptr< SocketNotifier > | makeNotifier (const bool enabled=true) const |
Private Attributes | |
int | _wakeupPipe [2] = { -1, -1 } |
Simple helper class that can be used to notify a thread to wake up. This is guaranteed to use signal safe means to wake up the thread.
zyppng::Wakeup::Wakeup | ( | ) |
Definition at line 11 of file wakeup.cpp.
zyppng::Wakeup::~Wakeup | ( | ) |
Definition at line 17 of file wakeup.cpp.
void zyppng::Wakeup::notify | ( | ) |
Post a notification to the thread.
Definition at line 23 of file wakeup.cpp.
void zyppng::Wakeup::ack | ( | ) |
Called from the thread to acknowledge and clear the wakeup signal
Definition at line 28 of file wakeup.cpp.
int zyppng::Wakeup::pollfd | ( | ) | const |
Returns the internal FD to be used in the thread to poll for notifications
Definition at line 34 of file wakeup.cpp.
std::shared_ptr< SocketNotifier > zyppng::Wakeup::makeNotifier | ( | const bool | enabled = true | ) | const |
Convenience function to create a zyppng::SocketNotifier that is listening for incoming notifications.
Definition at line 39 of file wakeup.cpp.