AK: Yield while waiting for another thread to initialize a Singleton

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

View file

@ -12,6 +12,8 @@
#ifdef KERNEL
# include <Kernel/Arch/Processor.h>
# include <Kernel/Arch/ScopedCritical.h>
#else
# include <sched.h>
#endif
#ifndef __serenity__
@ -58,7 +60,7 @@ public:
#ifdef KERNEL
Kernel::Processor::wait_check();
#else
// TODO: yield
sched_yield();
#endif
obj = obj_var.load(AK::memory_order_acquire);
}