From 39047db89008ea22607f0b2a334b384b45d1bfa9 Mon Sep 17 00:00:00 2001 From: salmon <573654187@qq.com> Date: Wed, 17 Mar 2021 17:05:00 +0800 Subject: [PATCH] Update SyncPrim/linux-sync-2.md Fix description error of __raw_cmpxchg --- SyncPrim/linux-sync-2.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SyncPrim/linux-sync-2.md b/SyncPrim/linux-sync-2.md index bf26e46..8b6fedc 100644 --- a/SyncPrim/linux-sync-2.md +++ b/SyncPrim/linux-sync-2.md @@ -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: