libzypp 17.37.17
wakeup.h
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8----------------------------------------------------------------------*/
9#ifndef ZYPP_NG_THREAD_WAKEUP_H_INCLUDED
10#define ZYPP_NG_THREAD_WAKEUP_H_INCLUDED
11
12#include <memory>
13
14namespace zyppng {
15
16 class SocketNotifier;
17
22 class Wakeup
23 {
24 public:
25 Wakeup();
26 ~Wakeup();
27
31 void notify();
32
37 void ack();
38
42 int pollfd() const;
43
48 std::shared_ptr<SocketNotifier> makeNotifier( const bool enabled = true ) const;
49
50 private:
51 int _wakeupPipe[2] = { -1, -1 };
52 };
53
54}
55
56
57
58#endif // ZYPP_NG_THREAD_WAKEUP_H_INCLUDED
std::shared_ptr< SocketNotifier > makeNotifier(const bool enabled=true) const
Definition wakeup.cpp:39
void notify()
Definition wakeup.cpp:23
int pollfd() const
Definition wakeup.cpp:34
int _wakeupPipe[2]
Definition wakeup.h:51