From 0b86d037672d01450d999f7cfb6f39236ed253f5 Mon Sep 17 00:00:00 2001 From: Frans Kaashoek Date: Thu, 30 Aug 2018 11:57:46 -0400 Subject: [PATCH] Because sleeplocks replaced B_BUSY the holding test can be more specific (thanks Mark Morrissey) --- sleeplock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sleeplock.c b/sleeplock.c index d0e4d91..e0750ea 100644 --- a/sleeplock.c +++ b/sleeplock.c @@ -47,7 +47,7 @@ holdingsleep(struct sleeplock *lk) int r; acquire(&lk->lk); - r = lk->locked; + r = lk->locked && (lk->pid == myproc()->pid); release(&lk->lk); return r; }