mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 05:37:34 +00:00
AK: Yield while waiting for another thread to initialize a Singleton
This commit is contained in:
parent
b0d51a6f36
commit
aa29e38ad5
1 changed files with 3 additions and 1 deletions
|
@ -12,6 +12,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
|
||||||
|
|
||||||
#ifndef __serenity__
|
#ifndef __serenity__
|
||||||
|
@ -58,7 +60,7 @@ public:
|
||||||
#ifdef KERNEL
|
#ifdef KERNEL
|
||||||
Kernel::Processor::wait_check();
|
Kernel::Processor::wait_check();
|
||||||
#else
|
#else
|
||||||
// TODO: yield
|
sched_yield();
|
||||||
#endif
|
#endif
|
||||||
obj = obj_var.load(AK::memory_order_acquire);
|
obj = obj_var.load(AK::memory_order_acquire);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue