diff options
author | Andreas Kling <kling@serenityos.org> | 2021-08-23 00:10:33 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-08-23 00:10:33 +0200 |
commit | 40bc378d81ba9b378e505621291d5d5145a58bcc (patch) | |
tree | 1256bd10f6667f3d684bb85c1f01c0ca8e2a9e11 | |
parent | b30081b49ac91953073fec0420652cb605a85388 (diff) | |
download | serenity-40bc378d81ba9b378e505621291d5d5145a58bcc.zip |
Kernel: Rename QueueBlocker => WaitQueueBlocker
This is a Thread::Blocker that blocks on a WaitQueue, so let's call it
a WaitQueueBlocker to improve clarity. :^)
-rw-r--r-- | Kernel/Thread.h | 8 | ||||
-rw-r--r-- | Kernel/ThreadBlockers.cpp | 6 | ||||
-rw-r--r-- | Kernel/WaitQueue.cpp | 6 | ||||
-rw-r--r-- | Kernel/WaitQueue.h | 4 |
4 files changed, 12 insertions, 12 deletions
diff --git a/Kernel/Thread.h b/Kernel/Thread.h index 4a954c0308..e2bf985841 100644 --- a/Kernel/Thread.h +++ b/Kernel/Thread.h @@ -522,10 +522,10 @@ public: bool m_should_block { true }; }; - class QueueBlocker final : public Blocker { + class WaitQueueBlocker final : public Blocker { public: - explicit QueueBlocker(WaitQueue&, StringView block_reason = {}); - virtual ~QueueBlocker(); + explicit WaitQueueBlocker(WaitQueue&, StringView block_reason = {}); + virtual ~WaitQueueBlocker(); virtual Type blocker_type() const override { return Type::Queue; } virtual StringView state_string() const override { return m_block_reason.is_null() ? m_block_reason : "Queue"sv; } @@ -981,7 +981,7 @@ public: Thread::BlockResult wait_on(WaitQueue& wait_queue, const Thread::BlockTimeout& timeout, Args&&... args) { VERIFY(this == Thread::current()); - return block<Thread::QueueBlocker>(timeout, wait_queue, forward<Args>(args)...); + return block<Thread::WaitQueueBlocker>(timeout, wait_queue, forward<Args>(args)...); } BlockResult sleep(clockid_t, const Time&, Time* = nullptr); diff --git a/Kernel/ThreadBlockers.cpp b/Kernel/ThreadBlockers.cpp index fd2ac4a06f..8768306011 100644 --- a/Kernel/ThreadBlockers.cpp +++ b/Kernel/ThreadBlockers.cpp @@ -118,18 +118,18 @@ bool Thread::JoinBlocker::unblock(void* value, bool from_add_blocker) return true; } -Thread::QueueBlocker::QueueBlocker(WaitQueue& wait_queue, StringView block_reason) +Thread::WaitQueueBlocker::WaitQueueBlocker(WaitQueue& wait_queue, StringView block_reason) : m_block_reason(block_reason) { if (!add_to_blocker_set(wait_queue, Thread::current())) m_should_block = false; } -Thread::QueueBlocker::~QueueBlocker() +Thread::WaitQueueBlocker::~WaitQueueBlocker() { } -bool Thread::QueueBlocker::unblock() +bool Thread::WaitQueueBlocker::unblock() { { SpinlockLocker lock(m_lock); diff --git a/Kernel/WaitQueue.cpp b/Kernel/WaitQueue.cpp index 65c74b3bdb..4a1d19a322 100644 --- a/Kernel/WaitQueue.cpp +++ b/Kernel/WaitQueue.cpp @@ -32,7 +32,7 @@ u32 WaitQueue::wake_one() bool did_unblock_one = unblock_all_blockers_whose_conditions_are_met_locked([&](Thread::Blocker& b, void* data, bool& stop_iterating) { VERIFY(data); VERIFY(b.blocker_type() == Thread::Blocker::Type::Queue); - auto& blocker = static_cast<Thread::QueueBlocker&>(b); + auto& blocker = static_cast<Thread::WaitQueueBlocker&>(b); dbgln_if(WAITQUEUE_DEBUG, "WaitQueue @ {}: wake_one unblocking {}", this, data); if (blocker.unblock()) { stop_iterating = true; @@ -57,7 +57,7 @@ u32 WaitQueue::wake_n(u32 wake_count) bool did_unblock_some = unblock_all_blockers_whose_conditions_are_met_locked([&](Thread::Blocker& b, void* data, bool& stop_iterating) { VERIFY(data); VERIFY(b.blocker_type() == Thread::Blocker::Type::Queue); - auto& blocker = static_cast<Thread::QueueBlocker&>(b); + auto& blocker = static_cast<Thread::WaitQueueBlocker&>(b); dbgln_if(WAITQUEUE_DEBUG, "WaitQueue @ {}: wake_n unblocking {}", this, data); VERIFY(did_wake < wake_count); if (blocker.unblock()) { @@ -82,7 +82,7 @@ u32 WaitQueue::wake_all() bool did_unblock_any = unblock_all_blockers_whose_conditions_are_met_locked([&](Thread::Blocker& b, void* data, bool&) { VERIFY(data); VERIFY(b.blocker_type() == Thread::Blocker::Type::Queue); - auto& blocker = static_cast<Thread::QueueBlocker&>(b); + auto& blocker = static_cast<Thread::WaitQueueBlocker&>(b); dbgln_if(WAITQUEUE_DEBUG, "WaitQueue @ {}: wake_all unblocking {}", this, data); diff --git a/Kernel/WaitQueue.h b/Kernel/WaitQueue.h index b093feeea8..c3c99ac3dc 100644 --- a/Kernel/WaitQueue.h +++ b/Kernel/WaitQueue.h @@ -27,13 +27,13 @@ public: template<class... Args> Thread::BlockResult wait_on(const Thread::BlockTimeout& timeout, Args&&... args) { - return Thread::current()->block<Thread::QueueBlocker>(timeout, *this, forward<Args>(args)...); + return Thread::current()->block<Thread::WaitQueueBlocker>(timeout, *this, forward<Args>(args)...); } template<class... Args> void wait_forever(Args&&... args) { - (void)Thread::current()->block<Thread::QueueBlocker>({}, *this, forward<Args>(args)...); + (void)Thread::current()->block<Thread::WaitQueueBlocker>({}, *this, forward<Args>(args)...); } protected: |