Allow holding to be called with interrupts enabled (for Mark Morrissey).

This commit is contained in:
Frans Kaashoek 2018-08-30 16:14:34 -04:00
parent 2c73068e82
commit 1d19081efb

View file

@ -89,7 +89,11 @@ getcallerpcs(void *v, uint pcs[])
int
holding(struct spinlock *lock)
{
return lock->locked && lock->cpu == mycpu();
int r;
pushcli();
r = lock->locked && lock->cpu == mycpu();
popcli();
return r;
}