1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:28:11 +00:00

Everywhere: Debug macros instead of constexpr.

This was done with the following script:

    find . \( -name '*.cpp' -o -name '*.h' -o -name '*.in' \) -not -path './Toolchain/*' -not -path './Build/*' -exec sed -i -E 's/dbgln<debug_([a-z_]+)>/dbgln<\U\1_DEBUG>/' {} \;

    find . \( -name '*.cpp' -o -name '*.h' -o -name '*.in' \) -not -path './Toolchain/*' -not -path './Build/*' -exec sed -i -E 's/if constexpr \(debug_([a-z0-9_]+)/if constexpr \(\U\1_DEBUG/' {} \;
This commit is contained in:
asynts 2021-01-23 23:59:27 +01:00 committed by Andreas Kling
parent bb483f7ef4
commit 8465683dcf
98 changed files with 414 additions and 972 deletions

View file

@ -37,22 +37,22 @@ bool WaitQueue::should_add_blocker(Thread::Blocker& b, void* data)
ASSERT(b.blocker_type() == Thread::Blocker::Type::Queue);
if (m_wake_requested) {
m_wake_requested = false;
dbgln<debug_waitqueue>("WaitQueue @ {}: do not block thread {}, wake was pending", this, data);
dbgln<WAITQUEUE_DEBUG>("WaitQueue @ {}: do not block thread {}, wake was pending", this, data);
return false;
}
dbgln<debug_waitqueue>("WaitQueue @ {}: should block thread {}", this, data);
dbgln<WAITQUEUE_DEBUG>("WaitQueue @ {}: should block thread {}", this, data);
return true;
}
void WaitQueue::wake_one()
{
ScopedSpinLock lock(m_lock);
dbgln<debug_waitqueue>("WaitQueue @ {}: wake_one", this);
dbgln<WAITQUEUE_DEBUG>("WaitQueue @ {}: wake_one", this);
bool did_unblock_one = do_unblock([&](Thread::Blocker& b, void* data, bool& stop_iterating) {
ASSERT(data);
ASSERT(b.blocker_type() == Thread::Blocker::Type::Queue);
auto& blocker = static_cast<Thread::QueueBlocker&>(b);
dbgln<debug_waitqueue>("WaitQueue @ {}: wake_one unblocking {}", this, data);
dbgln<WAITQUEUE_DEBUG>("WaitQueue @ {}: wake_one unblocking {}", this, data);
if (blocker.unblock()) {
stop_iterating = true;
return true;
@ -67,14 +67,14 @@ u32 WaitQueue::wake_n(u32 wake_count)
if (wake_count == 0)
return 0; // should we assert instead?
ScopedSpinLock lock(m_lock);
dbgln<debug_waitqueue>("WaitQueue @ {}: wake_n({})", this, wake_count);
dbgln<WAITQUEUE_DEBUG>("WaitQueue @ {}: wake_n({})", this, wake_count);
u32 did_wake = 0;
bool did_unblock_some = do_unblock([&](Thread::Blocker& b, void* data, bool& stop_iterating) {
ASSERT(data);
ASSERT(b.blocker_type() == Thread::Blocker::Type::Queue);
auto& blocker = static_cast<Thread::QueueBlocker&>(b);
dbgln<debug_waitqueue>("WaitQueue @ {}: wake_n unblocking {}", this, data);
dbgln<WAITQUEUE_DEBUG>("WaitQueue @ {}: wake_n unblocking {}", this, data);
ASSERT(did_wake < wake_count);
if (blocker.unblock()) {
if (++did_wake >= wake_count)
@ -91,7 +91,7 @@ u32 WaitQueue::wake_all()
{
ScopedSpinLock lock(m_lock);
dbgln<debug_waitqueue>("WaitQueue @ {}: wake_all", this);
dbgln<WAITQUEUE_DEBUG>("WaitQueue @ {}: wake_all", this);
u32 did_wake = 0;
bool did_unblock_any = do_unblock([&](Thread::Blocker& b, void* data, bool&) {
@ -99,7 +99,7 @@ u32 WaitQueue::wake_all()
ASSERT(b.blocker_type() == Thread::Blocker::Type::Queue);
auto& blocker = static_cast<Thread::QueueBlocker&>(b);
dbgln<debug_waitqueue>("WaitQueue @ {}: wake_all unblocking {}", this, data);
dbgln<WAITQUEUE_DEBUG>("WaitQueue @ {}: wake_all unblocking {}", this, data);
if (blocker.unblock()) {
did_wake++;