diff options
Diffstat (limited to 'src/event/Loop.hxx')
-rw-r--r-- | src/event/Loop.hxx | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/event/Loop.hxx b/src/event/Loop.hxx index 4bd2a3b2c..d03259fb0 100644 --- a/src/event/Loop.hxx +++ b/src/event/Loop.hxx @@ -98,6 +98,14 @@ class EventLoop final : SocketMonitor */ bool busy; +#ifndef NDEBUG + /** + * True if Run() was never called. This is used for assert() + * calls. + */ + bool virgin; +#endif + PollGroup poll_group; PollResult poll_result; @@ -200,6 +208,13 @@ public: #ifndef NDEBUG gcc_pure + bool IsInsideOrVirgin() const { + return virgin || IsInside(); + } +#endif + +#ifndef NDEBUG + gcc_pure bool IsInsideOrNull() const { return thread.IsNull() || thread.IsInside(); } |