mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 19:57:44 +00:00
AK: Yield while waiting for another thread to create a strong ref
This commit is contained in:
parent
aa29e38ad5
commit
404daa0e33
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…
Add table
Add a link
Reference in a new issue