]> Devi Nivas Git - cs3210-lab0.git/commitdiff
Because sleeplocks replaced B_BUSY the holding test can
authorFrans Kaashoek <kaashoek@mit.edu>
Thu, 30 Aug 2018 15:57:46 +0000 (11:57 -0400)
committerFrans Kaashoek <kaashoek@mit.edu>
Thu, 30 Aug 2018 15:57:46 +0000 (11:57 -0400)
be more specific (thanks Mark Morrissey)

sleeplock.c

index d0e4d918529d946ed19e7d3a48e92a0fa3be06fc..e0750ea443995eec9a604ec90da50a207e41b990 100644 (file)
@@ -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;
 }