summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2022-01-25 08:49:43 +0100
committerAndreas Kling <kling@serenityos.org>2022-01-25 09:13:40 +0100
commit3bab93c5e7a1890ea3b1f929d87c7586ef5c3f1b (patch)
treeebe10ff8848d6e8a3840dec1e3e2cd89ec3edca1 /Userland
parent8dfd1247187a30b9310be6d55edc64dae6ce7631 (diff)
downloadserenity-3bab93c5e7a1890ea3b1f929d87c7586ef5c3f1b.zip
LibCore: Make Core::s_main_event_loop actually global
This was accidentally per-TU, as it was declared "static" in the header.
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibCore/EventLoop.cpp2
-rw-r--r--Userland/Libraries/LibCore/EventLoop.h2
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<EventLoop*> s_main_event_loop;
static Threading::MutexProtected<NeverDestroyed<IDAllocator>> s_id_allocator;
static Threading::MutexProtected<RefPtr<InspectorServerConnection>> 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<EventLoop*> s_main_event_loop;
+extern Threading::MutexProtected<EventLoop*> s_main_event_loop;
class EventLoop {
public: