Skip to content

Commit

Permalink
Allow holding to be called with interrupts enabled (for Mark Morrissey).
Browse files Browse the repository at this point in the history
  • Loading branch information
kaashoek committed Aug 30, 2018
1 parent 2c73068 commit 1d19081
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion spinlock.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}


Expand Down

0 comments on commit 1d19081

Please sign in to comment.