summaryrefslogtreecommitdiff
path: root/spinlock.h
diff options
context:
space:
mode:
authorrsc <rsc>2006-09-07 14:12:30 +0000
committerrsc <rsc>2006-09-07 14:12:30 +0000
commit31085bb4166c18b3dee059160d64b4edd7c5e2f4 (patch)
treed3b166a2c39f77e06e7104659b537521282f9260 /spinlock.h
parent7e019461c8bf0afbe73f959ca3394cce832501fd (diff)
downloadxv6-labs-31085bb4166c18b3dee059160d64b4edd7c5e2f4.tar.gz
xv6-labs-31085bb4166c18b3dee059160d64b4edd7c5e2f4.tar.bz2
xv6-labs-31085bb4166c18b3dee059160d64b4edd7c5e2f4.zip
more comments
Diffstat (limited to 'spinlock.h')
-rw-r--r--spinlock.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/spinlock.h b/spinlock.h
index ae5ad1f..1a706cf 100644
--- a/spinlock.h
+++ b/spinlock.h
@@ -1,6 +1,10 @@
+// Mutual exclusion lock.
struct spinlock {
- char *name;
- uint locked;
- int cpu;
- uint pcs[10];
+ uint locked; // Is the lock held?
+
+ // For debugging:
+ char *name; // Name of lock.
+ int cpu; // The number of the cpu holding the lock.
+ uint pcs[10]; // The call stack (an array of program counters)
+ // that locked the lock.
};