From 3dcd5b0fd12426a33d5c057090bd4ace06283fea Mon Sep 17 00:00:00 2001 From: nannxnann <51177225+nannxnann@users.noreply.github.com> Date: Sun, 24 Jul 2022 20:46:04 +0800 Subject: [PATCH 1/3] typo in linux-sync-4.md? From " he implementation of the `__mutex_fastpath_lock` " => " `t`he implementation of the `__mutex_fastpath_lock` " Is this a typo? if not, I will close this PR, Thanks for your review. --- SyncPrim/linux-sync-4.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SyncPrim/linux-sync-4.md b/SyncPrim/linux-sync-4.md index 2e9d674..558486c 100644 --- a/SyncPrim/linux-sync-4.md +++ b/SyncPrim/linux-sync-4.md @@ -205,7 +205,7 @@ exit: return; ``` -For this moment he implementation of the `__mutex_fastpath_lock` function looks pretty easy. But the value of the `mutex->counter` may be negative after increment. In this case the: +For this moment the implementation of the `__mutex_fastpath_lock` function looks pretty easy. But the value of the `mutex->counter` may be negative after increment. In this case the: ```C fail_fn(v); From e9fbdea09a3e440fca87e764f7c015544d4695bf Mon Sep 17 00:00:00 2001 From: nannxnann <51177225+nannxnann@users.noreply.github.com> Date: Sun, 24 Jul 2022 21:12:38 +0800 Subject: [PATCH 2/3] fix typo in linux-sync-4.md From "function will `acct` like " => function will `act` like Maybe another typo or not? --- SyncPrim/linux-sync-4.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SyncPrim/linux-sync-4.md b/SyncPrim/linux-sync-4.md index 558486c..99adff0 100644 --- a/SyncPrim/linux-sync-4.md +++ b/SyncPrim/linux-sync-4.md @@ -303,7 +303,7 @@ static bool mutex_optimistic_spin(struct mutex *lock, #endif ``` -In all of these cases, the `__mutex_lock_common` function will acct like a `semaphore`. We try to acquire a lock again because the owner of a lock might already release a lock before this time: +In all of these cases, the `__mutex_lock_common` function will act like a `semaphore`. We try to acquire a lock again because the owner of a lock might already release a lock before this time: ```C if (!mutex_is_locked(lock) && From ea81d2b8338d76aedaf6daa03c48b98a8112703e Mon Sep 17 00:00:00 2001 From: nannxnann <51177225+nannxnann@users.noreply.github.com> Date: Sun, 24 Jul 2022 21:42:11 +0800 Subject: [PATCH 3/3] Update linux-sync-4.md From "may be negative after `increment`" =>"may be negative after `decrement`" --- SyncPrim/linux-sync-4.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SyncPrim/linux-sync-4.md b/SyncPrim/linux-sync-4.md index 99adff0..34c1e08 100644 --- a/SyncPrim/linux-sync-4.md +++ b/SyncPrim/linux-sync-4.md @@ -205,7 +205,7 @@ exit: return; ``` -For this moment the implementation of the `__mutex_fastpath_lock` function looks pretty easy. But the value of the `mutex->counter` may be negative after increment. In this case the: +For this moment the implementation of the `__mutex_fastpath_lock` function looks pretty easy. But the value of the `mutex->counter` may be negative after decrement. In this case the: ```C fail_fn(v);