mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:07: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
|
||||
# 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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue