mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 13:27:35 +00:00
Kernel: Do not wait before first attempt at locking SpinLock (#3212)
This commit is contained in:
parent
c711d34276
commit
983f4f935c
1 changed files with 3 additions and 3 deletions
|
@ -45,11 +45,11 @@ public:
|
|||
{
|
||||
u32 prev_flags;
|
||||
Processor::current().enter_critical(prev_flags);
|
||||
BaseType expected;
|
||||
do {
|
||||
BaseType expected = 0;
|
||||
while (!m_lock.compare_exchange_strong(expected, 1, AK::memory_order_acq_rel)) {
|
||||
Processor::wait_check();
|
||||
expected = 0;
|
||||
} while (!m_lock.compare_exchange_strong(expected, 1, AK::memory_order_acq_rel));
|
||||
}
|
||||
return prev_flags;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue