event/Loop: use C++11 initializers

This commit is contained in:
Max Kellermann 2016-12-27 23:08:11 +01:00
parent fdb136f1fa
commit 018c5ef731
2 changed files with 5 additions and 10 deletions

View File

@ -30,12 +30,7 @@
EventLoop::EventLoop()
:SocketMonitor(*this),
now_ms(::MonotonicClockMS()),
quit(false), busy(true),
#ifndef NDEBUG
virgin(true),
#endif
thread(ThreadId::Null())
now_ms(::MonotonicClockMS())
{
SocketMonitor::Open(wake_fd.Get());
SocketMonitor::Schedule(SocketMonitor::READ);

View File

@ -81,7 +81,7 @@ class EventLoop final : SocketMonitor
unsigned now_ms;
bool quit;
bool quit = false;
/**
* True when the object has been modified and another check is
@ -95,14 +95,14 @@ class EventLoop final : SocketMonitor
*
* Protected with #mutex.
*/
bool busy;
bool busy = true;
#ifndef NDEBUG
/**
* True if Run() was never called. This is used for assert()
* calls.
*/
bool virgin;
bool virgin = true;
#endif
PollGroup poll_group;
@ -111,7 +111,7 @@ class EventLoop final : SocketMonitor
/**
* A reference to the thread that is currently inside Run().
*/
ThreadId thread;
ThreadId thread = ThreadId::Null();
public:
EventLoop();