mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 00:50:22 +00:00
AK: Yield while waiting for another thread to initialize a Singleton
This commit is contained in:
parent
b0d51a6f36
commit
aa29e38ad5
Notes:
sideshowbarker
2024-07-17 20:39:39 +09:00
Author: https://github.com/IdanHo Commit: https://github.com/SerenityOS/serenity/commit/aa29e38ad53 Pull-request: https://github.com/SerenityOS/serenity/pull/12000
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…
Reference in a new issue