From 3bab93c5e7a1890ea3b1f929d87c7586ef5c3f1b Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 25 Jan 2022 08:49:43 +0100 Subject: [PATCH] LibCore: Make Core::s_main_event_loop actually global This was accidentally per-TU, as it was declared "static" in the header. --- Userland/Libraries/LibCore/EventLoop.cpp | 2 +- Userland/Libraries/LibCore/EventLoop.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibCore/EventLoop.cpp b/Userland/Libraries/LibCore/EventLoop.cpp index b7f6c109a7..1c9a4fdd07 100644 --- a/Userland/Libraries/LibCore/EventLoop.cpp +++ b/Userland/Libraries/LibCore/EventLoop.cpp @@ -62,7 +62,7 @@ struct EventLoop::Private { }; // The main event loop is global to the program, so it may be accessed from multiple threads. -// NOTE: s_main_event_loop is not declared here as it is needed in the header. +Threading::MutexProtected s_main_event_loop; static Threading::MutexProtected> s_id_allocator; static Threading::MutexProtected> s_inspector_server_connection; diff --git a/Userland/Libraries/LibCore/EventLoop.h b/Userland/Libraries/LibCore/EventLoop.h index a6efab523d..dbdaa146c1 100644 --- a/Userland/Libraries/LibCore/EventLoop.h +++ b/Userland/Libraries/LibCore/EventLoop.h @@ -25,7 +25,7 @@ namespace Core { -static Threading::MutexProtected s_main_event_loop; +extern Threading::MutexProtected s_main_event_loop; class EventLoop { public: