2011-08-29 23:18:40 +02:00
|
|
|
// Mutual exclusion lock.
|
2006-07-12 11:10:25 +02:00
|
|
|
struct spinlock {
|
2009-08-31 08:02:08 +02:00
|
|
|
uint locked; // Is the lock held?
|
2006-09-07 16:12:30 +02:00
|
|
|
|
|
|
|
// For debugging:
|
2009-08-31 08:02:08 +02:00
|
|
|
char *name; // Name of lock.
|
|
|
|
struct cpu *cpu; // The cpu holding the lock.
|
|
|
|
uint pcs[10]; // The call stack (an array of program counters)
|
|
|
|
// that locked the lock.
|
2006-07-12 11:10:25 +02:00
|
|
|
};
|
2007-08-28 07:00:39 +02:00
|
|
|
|