diff options
author | Max Kellermann <max@musicpd.org> | 2018-01-29 22:52:13 +0100 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2018-01-29 22:52:13 +0100 |
commit | ce68701c0cc8b55ef500a409320fa13d126e1b3f (patch) | |
tree | 203ae40508b5ba6e841ec5683557d7351359bab7 /src/event/Loop.hxx | |
parent | 6ea2cb3644c7915ab1262384edc4da5ff4917ca0 (diff) |
event/Loop: add flag "dead"
Diffstat (limited to 'src/event/Loop.hxx')
-rw-r--r-- | src/event/Loop.hxx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/event/Loop.hxx b/src/event/Loop.hxx index 788933f03..f578243d5 100644 --- a/src/event/Loop.hxx +++ b/src/event/Loop.hxx @@ -89,6 +89,11 @@ class EventLoop final : SocketMonitor std::atomic_bool quit; /** + * If this is true, then Run() has returned. + */ + std::atomic_bool dead; + + /** * True when the object has been modified and another check is * necessary before going to sleep via PollGroup::ReadEvents(). */ @@ -199,6 +204,10 @@ private: bool OnSocketReady(unsigned flags) noexcept override; public: + gcc_pure + bool IsDead() const noexcept { + return dead; + } /** * Are we currently running inside this EventLoop's thread? |