3a5fa7ed90
Remove I_BUSY, B_BUSY, and intrans defs and usages One spinlock per buf to avoid ugly loop in bget fix race in filewrite (don't update f->off after releasing lock)
17 lines
444 B
C
17 lines
444 B
C
// Mutual exclusion lock for short code fragments
|
|
struct spinlock {
|
|
uint locked; // Is the lock held?
|
|
|
|
// For debugging:
|
|
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.
|
|
};
|
|
|
|
// Lock that maybe held across sleeps
|
|
struct sleeplock {
|
|
uint locked; // Is the lock held?
|
|
};
|
|
|