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