event/Loop: use C++11 initializers
This commit is contained in:
parent
fdb136f1fa
commit
018c5ef731
@ -30,12 +30,7 @@
|
|||||||
|
|
||||||
EventLoop::EventLoop()
|
EventLoop::EventLoop()
|
||||||
:SocketMonitor(*this),
|
:SocketMonitor(*this),
|
||||||
now_ms(::MonotonicClockMS()),
|
now_ms(::MonotonicClockMS())
|
||||||
quit(false), busy(true),
|
|
||||||
#ifndef NDEBUG
|
|
||||||
virgin(true),
|
|
||||||
#endif
|
|
||||||
thread(ThreadId::Null())
|
|
||||||
{
|
{
|
||||||
SocketMonitor::Open(wake_fd.Get());
|
SocketMonitor::Open(wake_fd.Get());
|
||||||
SocketMonitor::Schedule(SocketMonitor::READ);
|
SocketMonitor::Schedule(SocketMonitor::READ);
|
||||||
|
@ -81,7 +81,7 @@ class EventLoop final : SocketMonitor
|
|||||||
|
|
||||||
unsigned now_ms;
|
unsigned now_ms;
|
||||||
|
|
||||||
bool quit;
|
bool quit = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* True when the object has been modified and another check is
|
* True when the object has been modified and another check is
|
||||||
@ -95,14 +95,14 @@ class EventLoop final : SocketMonitor
|
|||||||
*
|
*
|
||||||
* Protected with #mutex.
|
* Protected with #mutex.
|
||||||
*/
|
*/
|
||||||
bool busy;
|
bool busy = true;
|
||||||
|
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
/**
|
/**
|
||||||
* True if Run() was never called. This is used for assert()
|
* True if Run() was never called. This is used for assert()
|
||||||
* calls.
|
* calls.
|
||||||
*/
|
*/
|
||||||
bool virgin;
|
bool virgin = true;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
PollGroup poll_group;
|
PollGroup poll_group;
|
||||||
@ -111,7 +111,7 @@ class EventLoop final : SocketMonitor
|
|||||||
/**
|
/**
|
||||||
* A reference to the thread that is currently inside Run().
|
* A reference to the thread that is currently inside Run().
|
||||||
*/
|
*/
|
||||||
ThreadId thread;
|
ThreadId thread = ThreadId::Null();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
EventLoop();
|
EventLoop();
|
||||||
|
Loading…
Reference in New Issue
Block a user