nits
This commit is contained in:
parent
e6addf25bb
commit
4bc900e78b
|
@ -64,8 +64,10 @@ allocpid() {
|
||||||
int pid;
|
int pid;
|
||||||
|
|
||||||
acquire(&pid_lock);
|
acquire(&pid_lock);
|
||||||
pid = nextpid++;
|
pid = nextpid;
|
||||||
|
nextpid = nextpid + 1;
|
||||||
release(&pid_lock);
|
release(&pid_lock);
|
||||||
|
|
||||||
return pid;
|
return pid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,8 +18,6 @@ initlock(struct spinlock *lk, char *name)
|
||||||
|
|
||||||
// Acquire the lock.
|
// Acquire the lock.
|
||||||
// Loops (spins) until the lock is acquired.
|
// Loops (spins) until the lock is acquired.
|
||||||
// Holding a lock for a long time may cause
|
|
||||||
// other CPUs to waste time spinning to acquire it.
|
|
||||||
void
|
void
|
||||||
acquire(struct spinlock *lk)
|
acquire(struct spinlock *lk)
|
||||||
{
|
{
|
||||||
|
@ -81,7 +79,7 @@ holding(struct spinlock *lk)
|
||||||
}
|
}
|
||||||
|
|
||||||
// push_off/pop_off are like intr_off()/intr_on() except that they are matched:
|
// push_off/pop_off are like intr_off()/intr_on() except that they are matched:
|
||||||
// it takes two pop_off to undo two push_off. Also, if interrupts
|
// it takes two pop_off()s to undo two push_off()s. Also, if interrupts
|
||||||
// are initially off, then push_off, pop_off leaves them off.
|
// are initially off, then push_off, pop_off leaves them off.
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -5,7 +5,5 @@ struct spinlock {
|
||||||
// For debugging:
|
// For debugging:
|
||||||
char *name; // Name of lock.
|
char *name; // Name of lock.
|
||||||
struct cpu *cpu; // The cpu holding the lock.
|
struct cpu *cpu; // The cpu holding the lock.
|
||||||
struct cpu *last_release;
|
|
||||||
uint64 last_pc;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue