mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
LibCore: Add Core::EventLoop::has_been_instantiated()
This static bool getter can be used to VERIFY that an event loop exists, in situations where one is expected. This is helpful if the absence of an event loop would generate strange and/or loud errors that don't immediately point to this as a cause.
This commit is contained in:
parent
82d8cd2b87
commit
67a0fa2b78
Notes:
sideshowbarker
2024-07-18 05:17:13 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/67a0fa2b78f
2 changed files with 7 additions and 0 deletions
|
@ -62,6 +62,11 @@ static HashTable<Notifier*>* s_notifiers;
|
|||
int EventLoop::s_wake_pipe_fds[2];
|
||||
static RefPtr<InspectorServerConnection> s_inspector_server_connection;
|
||||
|
||||
bool EventLoop::has_been_instantiated()
|
||||
{
|
||||
return s_main_event_loop;
|
||||
}
|
||||
|
||||
class SignalHandlers : public RefCounted<SignalHandlers> {
|
||||
AK_MAKE_NONCOPYABLE(SignalHandlers);
|
||||
AK_MAKE_NONMOVABLE(SignalHandlers);
|
||||
|
|
|
@ -74,6 +74,8 @@ public:
|
|||
};
|
||||
static void notify_forked(ForkEvent);
|
||||
|
||||
static bool has_been_instantiated();
|
||||
|
||||
private:
|
||||
void wait_for_event(WaitMode);
|
||||
Optional<Time> get_next_timer_expiration();
|
||||
|
|
Loading…
Reference in a new issue