1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 06:17:35 +00:00

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

View file

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