summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibCore
diff options
context:
space:
mode:
authorBrian Gianforcaro <bgianf@serenityos.org>2021-05-10 01:21:35 -0700
committerAndreas Kling <kling@serenityos.org>2021-05-10 11:57:11 +0200
commit691b6f69c5bbb3e39b551c7878165083b8929203 (patch)
tree10ef8f97667a00711c7ee155b70337b183fe79a9 /Userland/Libraries/LibCore
parent0b7395848a7d5133f129e071d975931012bcfb02 (diff)
downloadserenity-691b6f69c5bbb3e39b551c7878165083b8929203.zip
LibThread: Remove LOCKER() macro, as it adds no value
The LOCKER() macro appears to have been added to LibThread as a userspace analog to the previous LOCKER() macro that existed in the kernel. The kernel version used the macro to inject __FILE__ and __LINE__ number into the lock acquisition for debugging. However AK::SourceLocation was used to remove the need for the macro. So the kernel version no longer exists. The LOCKER() in LibThread doesn't appear to actually need to be a macro, using the type directly works fine, and arguably is more readable as it removes an unnecessary level of indirection.
Diffstat (limited to 'Userland/Libraries/LibCore')
-rw-r--r--Userland/Libraries/LibCore/EventLoop.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/Userland/Libraries/LibCore/EventLoop.cpp b/Userland/Libraries/LibCore/EventLoop.cpp
index 670a8d0932..4226f02b05 100644
--- a/Userland/Libraries/LibCore/EventLoop.cpp
+++ b/Userland/Libraries/LibCore/EventLoop.cpp
@@ -372,7 +372,7 @@ void EventLoop::pump(WaitMode mode)
decltype(m_queued_events) events;
{
- LOCKER(m_private->lock);
+ LibThread::Locker locker(m_private->lock);
events = move(m_queued_events);
}
@@ -401,7 +401,7 @@ void EventLoop::pump(WaitMode mode)
}
if (m_exit_requested) {
- LOCKER(m_private->lock);
+ LibThread::Locker locker(m_private->lock);
dbgln_if(EVENTLOOP_DEBUG, "Core::EventLoop: Exit requested. Rejigging {} events.", events.size() - i);
decltype(m_queued_events) new_event_queue;
new_event_queue.ensure_capacity(m_queued_events.size() + events.size());
@@ -416,7 +416,7 @@ void EventLoop::pump(WaitMode mode)
void EventLoop::post_event(Object& receiver, NonnullOwnPtr<Event>&& event)
{
- LOCKER(m_private->lock);
+ LibThread::Locker lock(m_private->lock);
dbgln_if(EVENTLOOP_DEBUG, "Core::EventLoop::post_event: ({}) << receivier={}, event={}", m_queued_events.size(), receiver, event);
m_queued_events.empend(receiver, move(event));
}
@@ -601,7 +601,7 @@ retry:
bool queued_events_is_empty;
{
- LOCKER(m_private->lock);
+ LibThread::Locker locker(m_private->lock);
queued_events_is_empty = m_queued_events.is_empty();
}