1
0
mirror of https://github.com/0xAX/linux-insides.git synced 2024-12-22 14:48:08 +00:00

Merge pull request #770 from flyingsalmon/master

Update SyncPrim/linux-sync-2.md
This commit is contained in:
0xAX 2021-03-20 22:32:02 +06:00 committed by GitHub
commit 7f19a7fd3a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -244,7 +244,7 @@ Looks pretty easy, except for the `queued_spin_lock_slowpath` function. We see t
}) })
``` ```
which compares the `old` with the value pointed to by `ptr`. If they differ, it stores the `new` in the memory location which is pointed by the `ptr` and returns the initial value in this memory location. which compares the `old` with the value pointed to by `ptr`. If they are equal, it stores the `new` in the memory location which is pointed by the `ptr` and returns the initial value in this memory location.
Let's back to the `queued_spin_lock` function. Assuming that we are the first one who tried to acquire the lock, the `val` will be zero and we will return from the `queued_spin_lock` function: Let's back to the `queued_spin_lock` function. Assuming that we are the first one who tried to acquire the lock, the `val` will be zero and we will return from the `queued_spin_lock` function: