2006-09-07 16:12:30 +02:00
|
|
|
// Mutual exclusion lock.
|
2006-07-12 11:10:25 +02:00
|
|
|
struct spinlock {
|
2006-09-07 16:12:30 +02:00
|
|
|
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.
|
2006-07-12 11:10:25 +02:00
|
|
|
};
|
2007-08-28 07:00:39 +02:00
|
|
|
|