Prechádzať zdrojové kódy

removed unneeded code for queues that we removed

tarfeef101 6 rokov pred
rodič
commit
e8e277e94d
1 zmenil súbory, kde vykonal 3 pridanie a 8 odobranie
  1. 3 8
      kern/synchprobs/traffic_synch.c

+ 3 - 8
kern/synchprobs/traffic_synch.c

@@ -29,7 +29,6 @@ typedef struct car
 {
   Direction origin;
   Direction dest;
-  bool old;
   struct car * next;
   struct cv * cv;
 } car;
@@ -49,12 +48,11 @@ static car * newcar(Direction origin, Direction dest)
   
   if(!(temp))
   {
-    panic("Failed to create a car.");
+    panic("Failed to create a car.\n");
   }
   
   temp->origin = origin;
   temp->dest = dest;
-  temp->old = 0;
   temp->next = NULL;
   temp->cv = NULL;
   
@@ -68,7 +66,7 @@ static list * newlist()
   
   if(!(temp))
   {
-    panic("Could not allocate list.");
+    panic("Could not allocate list.\n");
   }
   
   temp->front = NULL;
@@ -94,7 +92,6 @@ static void push(car * newcar)
 // called when a car clears the intersection
 static void clearint(car * done)
 {
-  kprintf("vehicle cleared");
   car * temp = active->front;
   car * temp2 = NULL;
   
@@ -167,7 +164,7 @@ void intersection_sync_init()
   
   if (!(globlock))
   {
-    panic("Failed to create lock!");
+    panic("Failed to create lock!\n");
   }
   
   active = newlist();
@@ -229,8 +226,6 @@ void intersection_before_entry(Direction origin, Direction destination)
       }
       else
       {
-        new->old = 1; // make new "old", since now it has already waited once
-
         // create cv for temp if it doesn't have one yet
         if(!(temp->cv))
         {