1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-20 14:55:08 +00:00

Kernel: Add WaitQueue::wait_forever and it use it for all infinite waits.

In preparation for marking BlockingResult [[nodiscard]], there are a few
places that perform infinite waits, which we never observe the result of
the wait. Instead of suppressing them, add an alternate function which
returns void when performing and infinite wait.
This commit is contained in:
Brian Gianforcaro 2021-02-14 15:02:14 -08:00 committed by Andreas Kling
parent 4ac286903d
commit ddd79fe2cf
9 changed files with 15 additions and 9 deletions

View file

@ -36,7 +36,7 @@ void FinalizerTask::spawn()
finalizer_thread, "FinalizerTask", [](void*) {
Thread::current()->set_priority(THREAD_PRIORITY_LOW);
for (;;) {
g_finalizer_wait_queue->wait_on({}, "FinalizerTask");
g_finalizer_wait_queue->wait_forever("FinalizerTask");
if (g_finalizer_has_work.exchange(false, AK::MemoryOrder::memory_order_acq_rel) == true)
Thread::finalize_dying_threads();