summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2020-12-01 20:07:04 +0100
committerMax Kellermann <max@musicpd.org>2020-12-01 20:07:35 +0100
commitef8797821fa1c95691f069ab327e223647f622b2 (patch)
treeee2f9628b8377724b67ac850424c722eb38c8d73
parent5f2797e7cc3504b2c3fd85e8c33e30a4923f0b49 (diff)
event/Loop: inline field initializers
-rw-r--r--src/event/Loop.cxx7
-rw-r--r--src/event/Loop.hxx4
2 files changed, 4 insertions, 7 deletions
diff --git a/src/event/Loop.cxx b/src/event/Loop.cxx
index 64b237543..bdc526c2c 100644
--- a/src/event/Loop.cxx
+++ b/src/event/Loop.cxx
@@ -46,18 +46,15 @@ EventLoop::EventLoop(
ThreadId _thread
#endif
)
- :
#ifdef HAVE_THREADED_EVENT_LOOP
- wake_event(*this, BIND_THIS_METHOD(OnSocketReady)),
- thread(_thread),
+ :thread(_thread),
/* if this instance is hosted by an EventThread (no ThreadId
known yet) then we're not yet alive until the thread is
started; for the main EventLoop instance, we assume it's
already alive, because nobody but EventThread will call
SetAlive() */
- alive(!_thread.IsNull()),
+ alive(!_thread.IsNull())
#endif
- quit(false)
{
#ifdef HAVE_THREADED_EVENT_LOOP
wake_event.Open(SocketDescriptor(wake_fd.Get()));
diff --git a/src/event/Loop.hxx b/src/event/Loop.hxx
index 5032d18f1..dddabd9aa 100644
--- a/src/event/Loop.hxx
+++ b/src/event/Loop.hxx
@@ -63,7 +63,7 @@ class EventLoop final
{
#ifdef HAVE_THREADED_EVENT_LOOP
WakeFD wake_fd;
- SocketEvent wake_event;
+ SocketEvent wake_event{*this, BIND_THIS_METHOD(OnSocketReady)};
#endif
struct TimerCompare {
@@ -132,7 +132,7 @@ class EventLoop final
bool alive;
#endif
- std::atomic_bool quit;
+ std::atomic_bool quit{false};
/**
* True when the object has been modified and another check is