瀏覽代碼

didn't do a while

tarfeef101 6 年之前
父節點
當前提交
de006e8ac8
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      kern/thread/synch.c

+ 1 - 1
kern/thread/synch.c

@@ -189,7 +189,7 @@ void lock_acquire(struct lock * lock)
   
   spinlock_acquire(&(lock->spin));
   
-  if (lock->owner)
+  while (lock->owner)
   {
     wchan_lock(lock->wc);
     spinlock_release(&(lock->spin));