瀏覽代碼

adding debug prints

tarfeef101 6 年之前
父節點
當前提交
215016267e
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      kern/synchprobs/traffic_synch.c

+ 3 - 0
kern/synchprobs/traffic_synch.c

@@ -226,6 +226,7 @@ void intersection_before_entry(Direction origin, Direction destination)
           temp->cv = cv_create("carcv");
         }
         
+        kprintf("put something to sleep\n");
         cv_wait(temp->cv, globlock); // sleep and reacquire lock once woken
         goto RESTART; // now we have to make sure there's nothing else screwing us over
       }
@@ -237,6 +238,7 @@ void intersection_before_entry(Direction origin, Direction destination)
   }
   
   push(new);
+  kprintf("added a car to the int\n");
   lock_release(globlock);
 }
 
@@ -257,5 +259,6 @@ void intersection_after_exit(Direction origin, Direction destination)
   lock_acquire(globlock);
   int position = *(dirs + origin) + *(*(compass + origin) + destination);
   clearint(*(active + position));
+  kprintf("released a car from the int\n");
   lock_release(globlock);
 }