diff --git a/Libraries/LibCore/EventLoop.cpp b/Libraries/LibCore/EventLoop.cpp index e84068eb1ac..d8a164fdf39 100644 --- a/Libraries/LibCore/EventLoop.cpp +++ b/Libraries/LibCore/EventLoop.cpp @@ -65,11 +65,6 @@ void EventLoop::quit(int code) m_impl->quit(code); } -void EventLoop::unquit() -{ - m_impl->unquit(); -} - struct EventLoopPusher { public: EventLoopPusher(EventLoop& event_loop) @@ -91,7 +86,7 @@ int EventLoop::exec() void EventLoop::spin_until(Function goal_condition) { EventLoopPusher pusher(*this); - while (!m_impl->was_exit_requested() && !goal_condition()) + while (!goal_condition()) pump(); } @@ -120,11 +115,6 @@ void EventLoop::unregister_signal(int handler_id) EventLoopManager::the().unregister_signal(handler_id); } -void EventLoop::notify_forked(ForkEvent) -{ - current().m_impl->notify_forked_and_in_child(); -} - intptr_t EventLoop::register_timer(EventReceiver& object, int milliseconds, bool should_reload, TimerShouldFireWhenNotVisible fire_when_not_visible) { return EventLoopManager::the().register_timer(object, milliseconds, should_reload, fire_when_not_visible); @@ -161,9 +151,4 @@ void deferred_invoke(Function invokee) EventLoop::current().deferred_invoke(move(invokee)); } -bool EventLoop::was_exit_requested() const -{ - return m_impl->was_exit_requested(); -} - } diff --git a/Libraries/LibCore/EventLoop.h b/Libraries/LibCore/EventLoop.h index 89b462e4d3d..3de9c91bf54 100644 --- a/Libraries/LibCore/EventLoop.h +++ b/Libraries/LibCore/EventLoop.h @@ -72,8 +72,6 @@ public: void wake(); void quit(int); - void unquit(); - bool was_exit_requested() const; // The registration functions act upon the current loop of the current thread. static intptr_t register_timer(EventReceiver&, int milliseconds, bool should_reload, TimerShouldFireWhenNotVisible); @@ -85,13 +83,6 @@ public: static int register_signal(int signo, ESCAPING Function handler); static void unregister_signal(int handler_id); - // Note: Boost uses Parent/Child/Prepare, but we don't really have anything - // interesting to do in the parent or before forking. - enum class ForkEvent { - Child, - }; - static void notify_forked(ForkEvent); - static bool is_running(); static EventLoop& current(); diff --git a/Libraries/LibCore/EventLoopImplementation.h b/Libraries/LibCore/EventLoopImplementation.h index 4d0d25ac232..f1929417b45 100644 --- a/Libraries/LibCore/EventLoopImplementation.h +++ b/Libraries/LibCore/EventLoopImplementation.h @@ -55,11 +55,6 @@ public: virtual void post_event(EventReceiver& receiver, NonnullOwnPtr&&) = 0; - // FIXME: These APIs only exist for obscure use-cases inside SerenityOS. Try to get rid of them. - virtual void unquit() = 0; - virtual bool was_exit_requested() const = 0; - virtual void notify_forked_and_in_child() = 0; - protected: EventLoopImplementation(); ThreadEventQueue& m_thread_event_queue; diff --git a/Libraries/LibCore/EventLoopImplementationUnix.cpp b/Libraries/LibCore/EventLoopImplementationUnix.cpp index b271b4fb117..f323d90bf92 100644 --- a/Libraries/LibCore/EventLoopImplementationUnix.cpp +++ b/Libraries/LibCore/EventLoopImplementationUnix.cpp @@ -330,17 +330,6 @@ void EventLoopImplementationUnix::quit(int code) m_exit_code = code; } -void EventLoopImplementationUnix::unquit() -{ - m_exit_requested = false; - m_exit_code = 0; -} - -bool EventLoopImplementationUnix::was_exit_requested() const -{ - return m_exit_requested; -} - void EventLoopImplementationUnix::post_event(EventReceiver& receiver, NonnullOwnPtr&& event) { m_thread_event_queue.post_event(receiver, move(event)); @@ -522,21 +511,6 @@ void EventLoopManagerUnix::dispatch_signal(int signal_number) } } -void EventLoopImplementationUnix::notify_forked_and_in_child() -{ - auto& thread_data = ThreadData::the(); - thread_data.timeouts.clear(); - thread_data.poll_fds.clear(); - thread_data.notifier_by_ptr.clear(); - thread_data.notifier_by_index.clear(); - thread_data.initialize_wake_pipe(); - if (auto* info = signals_info()) { - info->signal_handlers.clear(); - info->next_signal_id = 0; - } - thread_data.pid = getpid(); -} - SignalHandlers::SignalHandlers(int signal_number, void (*handle_signal)(int)) : m_signal_number(signal_number) , m_original_handler(signal(signal_number, handle_signal)) diff --git a/Libraries/LibCore/EventLoopImplementationUnix.h b/Libraries/LibCore/EventLoopImplementationUnix.h index 555a83fce7d..3c697c0e715 100644 --- a/Libraries/LibCore/EventLoopImplementationUnix.h +++ b/Libraries/LibCore/EventLoopImplementationUnix.h @@ -49,9 +49,6 @@ public: virtual void wake() override; - virtual void unquit() override; - virtual bool was_exit_requested() const override; - virtual void notify_forked_and_in_child() override; virtual void post_event(EventReceiver& receiver, NonnullOwnPtr&&) override; private: diff --git a/Libraries/LibCore/EventLoopImplementationWindows.cpp b/Libraries/LibCore/EventLoopImplementationWindows.cpp index 15d162a2163..27dfc0f1dfd 100644 --- a/Libraries/LibCore/EventLoopImplementationWindows.cpp +++ b/Libraries/LibCore/EventLoopImplementationWindows.cpp @@ -134,17 +134,6 @@ void EventLoopImplementationWindows::quit(int code) m_exit_code = code; } -void EventLoopImplementationWindows::unquit() -{ - m_exit_requested = false; - m_exit_code = 0; -} - -bool EventLoopImplementationWindows::was_exit_requested() const -{ - return m_exit_requested; -} - void EventLoopImplementationWindows::post_event(EventReceiver& receiver, NonnullOwnPtr&& event) { m_thread_event_queue.post_event(receiver, move(event)); @@ -157,12 +146,6 @@ void EventLoopImplementationWindows::wake() SetEvent(m_wake_event); } -void EventLoopImplementationWindows::notify_forked_and_in_child() -{ - dbgln("Core::EventLoopManagerWindows::notify_forked_and_in_child() is not implemented"); - VERIFY_NOT_REACHED(); -} - static int notifier_type_to_network_event(NotificationType type) { switch (type) { diff --git a/Libraries/LibCore/EventLoopImplementationWindows.h b/Libraries/LibCore/EventLoopImplementationWindows.h index b3e692d7b24..72e721e821c 100644 --- a/Libraries/LibCore/EventLoopImplementationWindows.h +++ b/Libraries/LibCore/EventLoopImplementationWindows.h @@ -42,9 +42,6 @@ public: virtual void wake() override; - virtual void unquit() override; - virtual bool was_exit_requested() const override; - virtual void notify_forked_and_in_child() override; virtual void post_event(EventReceiver& receiver, NonnullOwnPtr&&) override; private: diff --git a/Libraries/LibWebView/EventLoop/EventLoopImplementationMacOS.h b/Libraries/LibWebView/EventLoop/EventLoopImplementationMacOS.h index 8edf8dea65c..bee5c580c77 100644 --- a/Libraries/LibWebView/EventLoop/EventLoopImplementationMacOS.h +++ b/Libraries/LibWebView/EventLoop/EventLoopImplementationMacOS.h @@ -41,11 +41,6 @@ public: virtual void wake() override; virtual void post_event(Core::EventReceiver& receiver, NonnullOwnPtr&&) override; - // FIXME: These APIs only exist for obscure use-cases inside SerenityOS. Try to get rid of them. - virtual void unquit() override { } - virtual bool was_exit_requested() const override { return false; } - virtual void notify_forked_and_in_child() override { } - private: EventLoopImplementationMacOS() = default; diff --git a/Libraries/LibWebView/EventLoop/EventLoopImplementationQt.h b/Libraries/LibWebView/EventLoop/EventLoopImplementationQt.h index 05358cff1a7..00104d6f37f 100644 --- a/Libraries/LibWebView/EventLoop/EventLoopImplementationQt.h +++ b/Libraries/LibWebView/EventLoop/EventLoopImplementationQt.h @@ -59,11 +59,6 @@ public: virtual void wake() override; virtual void post_event(Core::EventReceiver& receiver, NonnullOwnPtr&&) override; - // FIXME: These APIs only exist for obscure use-cases inside SerenityOS. Try to get rid of them. - virtual void unquit() override { } - virtual bool was_exit_requested() const override { return false; } - virtual void notify_forked_and_in_child() override { } - void set_main_loop(); private: