AK: Yield while waiting for another thread to create a strong ref

This commit is contained in:
Idan Horowitz 2022-01-18 22:21:37 +02:00 committed by Andreas Kling
parent aa29e38ad5
commit 404daa0e33
Notes: sideshowbarker 2024-07-17 20:39:35 +09:00

View file

@ -14,6 +14,8 @@
#ifdef KERNEL
# include <Kernel/Arch/Processor.h>
# include <Kernel/Arch/ScopedCritical.h>
#else
# include <sched.h>
#endif
namespace AK {
@ -79,7 +81,7 @@ public:
#ifdef KERNEL
Kernel::Processor::wait_check();
#else
// TODO: yield?
sched_yield();
#endif
current_consumers = m_consumers.load(AK::MemoryOrder::memory_order_acquire) & ~1u;
}