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 create a strong ref
This commit is contained in:
parent
aa29e38ad5
commit
404daa0e33
Notes:
sideshowbarker
2024-07-17 20:39:35 +09:00
Author: https://github.com/IdanHo Commit: https://github.com/SerenityOS/serenity/commit/404daa0e33f Pull-request: https://github.com/SerenityOS/serenity/pull/12000
1 changed files with 3 additions and 1 deletions
|
@ -14,6 +14,8 @@
|
|||
#ifdef KERNEL
|
||||
# include <Kernel/Arch/Processor.h>
|
||||
# include <Kernel/Arch/ScopedCritical.h>
|
||||
#else
|
||||
# include <sched.h>
|
||||
#endif
|
||||
|
||||
namespace AK {
|
||||
|
@ -79,7 +81,7 @@ public:
|
|||
#ifdef KERNEL
|
||||
Kernel::Processor::wait_check();
|
||||
#else
|
||||
// TODO: yield?
|
||||
sched_yield();
|
||||
#endif
|
||||
current_consumers = m_consumers.load(AK::MemoryOrder::memory_order_acquire) & ~1u;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue