소스 검색

Kernel: Rename QueueBlocker => WaitQueueBlocker

This is a Thread::Blocker that blocks on a WaitQueue, so let's call it
a WaitQueueBlocker to improve clarity. :^)
Andreas Kling 3 년 전
부모
커밋
40bc378d81
4개의 변경된 파일12개의 추가작업 그리고 12개의 파일을 삭제
  1. 4 4
      Kernel/Thread.h
  2. 3 3
      Kernel/ThreadBlockers.cpp
  3. 3 3
      Kernel/WaitQueue.cpp
  4. 2 2
      Kernel/WaitQueue.h

+ 4 - 4
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);

+ 3 - 3
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);

+ 3 - 3
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);
 

+ 2 - 2
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: