summaryrefslogtreecommitdiff
path: root/spinlock.h
diff options
context:
space:
mode:
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.
};