mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
Kernel: Do not wait before first attempt at locking SpinLock (#3212)
This commit is contained in:
parent
c711d34276
commit
983f4f935c
Notes:
sideshowbarker
2024-07-19 03:25:58 +09:00
Author: https://github.com/tryfinally Commit: https://github.com/SerenityOS/serenity/commit/983f4f935c4 Pull-request: https://github.com/SerenityOS/serenity/pull/3212
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…
Reference in a new issue