Sfoglia il codice sorgente

Merge pull request #731 from dragonly/fix-linux-sync-2

fix typo: &lock-val to &lock->val
Sebastian Fricke 4 anni fa
parent
commit
12080c0912
1 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. 2 2
      SyncPrim/linux-sync-2.md

+ 2 - 2
SyncPrim/linux-sync-2.md

@@ -249,7 +249,7 @@ which compares the `old` with the value pointed to by `ptr`.  If they differ, it
 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:
 
 ```C
-	val = atomic_cmpxchg_acquire(&lock-val, 0, _Q_LOCKED_VAL);
+	val = atomic_cmpxchg_acquire(&lock->val, 0, _Q_LOCKED_VAL);
 	if (likely(val == 0))
 		return;
 ```
@@ -264,7 +264,7 @@ void queued_spin_lock_slowpath(struct qspinlock *lock, u32 val)
 	...
 	if (val == _Q_PENDING_VAL) {
 		int cnt = _Q_PENDING_LOOPS;
-		val = atomic_cond_read_relaxed(&lock-val,
+		val = atomic_cond_read_relaxed(&lock->val,
 					       (VAL != _Q_PENDING_VAL) || !cnt--);
 	}
 	...