mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-11 02:29:21 +00:00
CLock: Remove a redundant call to gettid().
This commit is contained in:
parent
b34f376329
commit
202e922ce8
Notes:
sideshowbarker
2024-07-19 14:23:22 +09:00
Author: https://github.com/awesomekling
Commit: 202e922ce8
1 changed files with 3 additions and 2 deletions
|
@ -44,10 +44,11 @@ private:
|
|||
|
||||
[[gnu::always_inline]] inline void CLock::lock()
|
||||
{
|
||||
int tid = gettid();
|
||||
for (;;) {
|
||||
if (CAS(&m_lock, 1, 0) == 0) {
|
||||
if (m_holder == -1 || m_holder == gettid()) {
|
||||
m_holder = gettid();
|
||||
if (m_holder == -1 || m_holder == tid) {
|
||||
m_holder = tid;
|
||||
++m_level;
|
||||
memory_barrier();
|
||||
m_lock = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue