annotate uprogs/spinlock.h @ 0:ed10291ff195

first commit
author mir3636
date Sun, 06 Jan 2019 19:27:03 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
ed10291ff195 first commit
mir3636
parents:
diff changeset
1 // Mutual exclusion lock.
ed10291ff195 first commit
mir3636
parents:
diff changeset
2 struct spinlock {
ed10291ff195 first commit
mir3636
parents:
diff changeset
3 uint locked; // Is the lock held?
ed10291ff195 first commit
mir3636
parents:
diff changeset
4
ed10291ff195 first commit
mir3636
parents:
diff changeset
5 // For debugging:
ed10291ff195 first commit
mir3636
parents:
diff changeset
6 char *name; // Name of lock.
ed10291ff195 first commit
mir3636
parents:
diff changeset
7 struct cpu *cpu; // The cpu holding the lock.
ed10291ff195 first commit
mir3636
parents:
diff changeset
8 uint pcs[10]; // The call stack (an array of program counters)
ed10291ff195 first commit
mir3636
parents:
diff changeset
9 // that locked the lock.
ed10291ff195 first commit
mir3636
parents:
diff changeset
10 };
ed10291ff195 first commit
mir3636
parents:
diff changeset
11