2011-08-29 21:18:40 +00:00
|
|
|
// Mutual exclusion lock.
|
2006-07-12 09:10:25 +00:00
|
|
|
struct spinlock {
|
2009-08-31 06:02:08 +00:00
|
|
|
uint locked; // Is the lock held?
|
2016-08-25 13:13:00 +00:00
|
|
|
|
2006-09-07 14:12:30 +00:00
|
|
|
// For debugging:
|
2009-08-31 06:02:08 +00:00
|
|
|
char *name; // Name of lock.
|
|
|
|
struct cpu *cpu; // The cpu holding the lock.
|
2019-07-02 17:40:33 +00:00
|
|
|
struct cpu *last_release;
|
|
|
|
uint64 last_pc;
|
2006-07-12 09:10:25 +00:00
|
|
|
};
|
2007-08-28 05:00:39 +00:00
|
|
|
|