summaryrefslogtreecommitdiff
path: root/Kernel/FutexQueue.cpp
diff options
context:
space:
mode:
authorAnotherTest <ali.mpfard@gmail.com>2021-02-07 15:33:24 +0330
committerAndreas Kling <kling@serenityos.org>2021-02-08 18:08:55 +0100
commit09a43969ba957b3484cc9387344fea145f46aa46 (patch)
tree0e2077e1d8af02b06e39cb4ca6cbfcba37052c73 /Kernel/FutexQueue.cpp
parent1f8a633cc762fc3ca8544ee75ce25a7a8860d4be (diff)
downloadserenity-09a43969ba957b3484cc9387344fea145f46aa46.zip
Everywhere: Replace dbgln<flag>(...) with dbgln_if(flag, ...)
Replacement made by `find Kernel Userland -name '*.h' -o -name '*.cpp' | sed -i -Ee 's/dbgln\b<(\w+)>\(/dbgln_if(\1, /g'`
Diffstat (limited to 'Kernel/FutexQueue.cpp')
-rw-r--r--Kernel/FutexQueue.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/Kernel/FutexQueue.cpp b/Kernel/FutexQueue.cpp
index ab3bfd959e..3dc558def9 100644
--- a/Kernel/FutexQueue.cpp
+++ b/Kernel/FutexQueue.cpp
@@ -36,7 +36,7 @@ bool FutexQueue::should_add_blocker(Thread::Blocker& b, void* data)
ASSERT(m_lock.is_locked());
ASSERT(b.blocker_type() == Thread::Blocker::Type::Futex);
- dbgln<FUTEXQUEUE_DEBUG>("FutexQueue @ {}: should block thread {}", this, *static_cast<Thread*>(data));
+ dbgln_if(FUTEXQUEUE_DEBUG, "FutexQueue @ {}: should block thread {}", this, *static_cast<Thread*>(data));
return true;
}
@@ -46,7 +46,7 @@ u32 FutexQueue::wake_n_requeue(u32 wake_count, const Function<FutexQueue*()>& ge
is_empty_target = false;
ScopedSpinLock lock(m_lock);
- dbgln<FUTEXQUEUE_DEBUG>("FutexQueue @ {}: wake_n_requeue({}, {})", this, wake_count, requeue_count);
+ dbgln_if(FUTEXQUEUE_DEBUG, "FutexQueue @ {}: wake_n_requeue({}, {})", this, wake_count, requeue_count);
u32 did_wake = 0, did_requeue = 0;
do_unblock([&](Thread::Blocker& b, void* data, bool& stop_iterating) {
@@ -54,7 +54,7 @@ u32 FutexQueue::wake_n_requeue(u32 wake_count, const Function<FutexQueue*()>& ge
ASSERT(b.blocker_type() == Thread::Blocker::Type::Futex);
auto& blocker = static_cast<Thread::FutexBlocker&>(b);
- dbgln<FUTEXQUEUE_DEBUG>("FutexQueue @ {}: wake_n_requeue unblocking {}", this, *static_cast<Thread*>(data));
+ dbgln_if(FUTEXQUEUE_DEBUG, "FutexQueue @ {}: wake_n_requeue unblocking {}", this, *static_cast<Thread*>(data));
ASSERT(did_wake < wake_count);
if (blocker.unblock()) {
if (++did_wake >= wake_count)
@@ -68,7 +68,7 @@ u32 FutexQueue::wake_n_requeue(u32 wake_count, const Function<FutexQueue*()>& ge
auto blockers_to_requeue = do_take_blockers(requeue_count);
if (!blockers_to_requeue.is_empty()) {
if (auto* target_futex_queue = get_target_queue()) {
- dbgln<FUTEXQUEUE_DEBUG>("FutexQueue @ {}: wake_n_requeue requeueing {} blockers to {}", this, blockers_to_requeue.size(), target_futex_queue);
+ dbgln_if(FUTEXQUEUE_DEBUG, "FutexQueue @ {}: wake_n_requeue requeueing {} blockers to {}", this, blockers_to_requeue.size(), target_futex_queue);
// While still holding m_lock, notify each blocker
for (auto& info : blockers_to_requeue) {
@@ -91,7 +91,7 @@ u32 FutexQueue::wake_n_requeue(u32 wake_count, const Function<FutexQueue*()>& ge
target_futex_queue->do_append_blockers(move(blockers_to_requeue));
is_empty_target = target_futex_queue->is_empty_locked();
} else {
- dbgln<FUTEXQUEUE_DEBUG>("FutexQueue @ {}: wake_n_requeue could not get target queue to requeue {} blockers", this, blockers_to_requeue.size());
+ dbgln_if(FUTEXQUEUE_DEBUG, "FutexQueue @ {}: wake_n_requeue could not get target queue to requeue {} blockers", this, blockers_to_requeue.size());
do_append_blockers(move(blockers_to_requeue));
}
}
@@ -104,14 +104,14 @@ u32 FutexQueue::wake_n(u32 wake_count, const Optional<u32>& bitset, bool& is_emp
if (wake_count == 0)
return 0; // should we assert instead?
ScopedSpinLock lock(m_lock);
- dbgln<FUTEXQUEUE_DEBUG>("FutexQueue @ {}: wake_n({})", this, wake_count);
+ dbgln_if(FUTEXQUEUE_DEBUG, "FutexQueue @ {}: wake_n({})", this, wake_count);
u32 did_wake = 0;
do_unblock([&](Thread::Blocker& b, void* data, bool& stop_iterating) {
ASSERT(data);
ASSERT(b.blocker_type() == Thread::Blocker::Type::Futex);
auto& blocker = static_cast<Thread::FutexBlocker&>(b);
- dbgln<FUTEXQUEUE_DEBUG>("FutexQueue @ {}: wake_n unblocking {}", this, *static_cast<Thread*>(data));
+ dbgln_if(FUTEXQUEUE_DEBUG, "FutexQueue @ {}: wake_n unblocking {}", this, *static_cast<Thread*>(data));
ASSERT(did_wake < wake_count);
if (bitset.has_value() ? blocker.unblock_bitset(bitset.value()) : blocker.unblock()) {
if (++did_wake >= wake_count)
@@ -127,13 +127,13 @@ u32 FutexQueue::wake_n(u32 wake_count, const Optional<u32>& bitset, bool& is_emp
u32 FutexQueue::wake_all(bool& is_empty)
{
ScopedSpinLock lock(m_lock);
- dbgln<FUTEXQUEUE_DEBUG>("FutexQueue @ {}: wake_all", this);
+ dbgln_if(FUTEXQUEUE_DEBUG, "FutexQueue @ {}: wake_all", this);
u32 did_wake = 0;
do_unblock([&](Thread::Blocker& b, void* data, bool&) {
ASSERT(data);
ASSERT(b.blocker_type() == Thread::Blocker::Type::Futex);
auto& blocker = static_cast<Thread::FutexBlocker&>(b);
- dbgln<FUTEXQUEUE_DEBUG>("FutexQueue @ {}: wake_all unblocking {}", this, *static_cast<Thread*>(data));
+ dbgln_if(FUTEXQUEUE_DEBUG, "FutexQueue @ {}: wake_all unblocking {}", this, *static_cast<Thread*>(data));
if (blocker.unblock(true)) {
did_wake++;
return true;