[kernel] Add clear() method to wait_queue

Allow objects to clear out the wait_queue earlier than waiting for the
destructor by moving that functionality into wait_queue::clear().
This commit is contained in:
Justin C. Miller
2022-02-28 20:06:49 -08:00
parent 19105542e5
commit 446025fb65
4 changed files with 17 additions and 10 deletions

View File

@@ -37,6 +37,9 @@ public:
/// Get the spinlock to lock this queue
util::spinlock & get_lock() { return m_lock; }
/// Wake and clear out all threads.
void clear();
private:
/// Get rid of any exited threads that are next
/// in the queue. Caller must hold the queue lock.