summaryrefslogtreecommitdiff
path: root/Libraries
diff options
context:
space:
mode:
authorBrandon Scott <xeons@users.noreply.github.com>2019-10-25 00:18:31 -0500
committerAndreas Kling <awesomekling@gmail.com>2019-10-25 15:29:19 +0200
commit5311f8fae11cbc611abea61fda570a11ce3edee5 (patch)
tree505ada424102e31ea43c019deddb02ed4ce77c2d /Libraries
parentf256c55e8d4b5448bbb9b91d0ef253d7ab574d20 (diff)
downloadserenity-5311f8fae11cbc611abea61fda570a11ce3edee5.zip
LibCore: Added unquit() method to CEventLoop.
Added an unquit() method to CEventLoop allowing you to cancel a pending exit request.
Diffstat (limited to 'Libraries')
-rw-r--r--Libraries/LibCore/CEventLoop.cpp7
-rw-r--r--Libraries/LibCore/CEventLoop.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/Libraries/LibCore/CEventLoop.cpp b/Libraries/LibCore/CEventLoop.cpp
index 17be63d020..425e18a678 100644
--- a/Libraries/LibCore/CEventLoop.cpp
+++ b/Libraries/LibCore/CEventLoop.cpp
@@ -186,6 +186,13 @@ void CEventLoop::quit(int code)
m_exit_code = code;
}
+void CEventLoop::unquit()
+{
+ dbg() << "CEventLoop::unquit()";
+ m_exit_requested = false;
+ m_exit_code = 0;
+}
+
struct CEventLoopPusher {
public:
CEventLoopPusher(CEventLoop& event_loop)
diff --git a/Libraries/LibCore/CEventLoop.h b/Libraries/LibCore/CEventLoop.h
index d4de3fc211..5166b79093 100644
--- a/Libraries/LibCore/CEventLoop.h
+++ b/Libraries/LibCore/CEventLoop.h
@@ -45,6 +45,7 @@ public:
static void unregister_notifier(Badge<CNotifier>, CNotifier&);
void quit(int);
+ void unquit();
void take_pending_events_from(CEventLoop& other)
{