diff options
author | kaashoek <kaashoek> | 2006-09-08 14:36:44 +0000 |
---|---|---|
committer | kaashoek <kaashoek> | 2006-09-08 14:36:44 +0000 |
commit | 8e1d1ec934d5ebcd4d8208f88857be12c8a97a06 (patch) | |
tree | 9df339c0bcd494c2e60f63650cac001c62b1ebd2 /spinlock.c | |
parent | 50f88503664aae07e22e3ed2575853e396f909b5 (diff) | |
download | xv6-labs-8e1d1ec934d5ebcd4d8208f88857be12c8a97a06.tar.gz xv6-labs-8e1d1ec934d5ebcd4d8208f88857be12c8a97a06.tar.bz2 xv6-labs-8e1d1ec934d5ebcd4d8208f88857be12c8a97a06.zip |
some comment changes
Diffstat (limited to 'spinlock.c')
-rw-r--r-- | spinlock.c | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -51,10 +51,9 @@ acquire(struct spinlock *lock) while(cmpxchg(0, 1, &lock->locked) == 1) ; - // Now that lock is acquired, make sure - // we wait for all pending writes from other - // processors. - cpuid(0, 0, 0, 0, 0); // memory barrier + // Serialize instructions: now that lock is acquired, make sure + // we wait for all pending writes from other processors. + cpuid(0, 0, 0, 0, 0); // memory barrier (see Ch 7 of IA-32 manual, vol 3) // Record info about lock acquisition for debugging. // The +10 is only so that we can tell the difference @@ -74,9 +73,9 @@ release(struct spinlock *lock) lock->pcs[0] = 0; lock->cpu = 0xffffffff; - // Before unlocking the lock, make sure to flush - // any pending memory writes from this processor. - cpuid(0, 0, 0, 0, 0); // memory barrier + // Serialize instructions: before unlocking the lock, make sure + // to flush any pending memory writes from this processor. + cpuid(0, 0, 0, 0, 0); // memory barrier (see Ch 7 of IA-32 manual, vol 3) lock->locked = 0; if(--cpus[cpu()].nlock == 0) |