Преглед на файлове

so apparently the execution time of threads is random, so we have to ensure we don't let 2 cars go from the same place to the same place at the same time, or we don't know which one to delete when exit is called, since that only give coords

tarfeef101 преди 6 години
родител
ревизия
63613967fd
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      kern/synchprobs/traffic_synch.c

+ 1 - 1
kern/synchprobs/traffic_synch.c

@@ -229,7 +229,7 @@ void intersection_before_entry(Direction origin, Direction destination)
     while (temp)
     {
       //kprintf("New o: %d, Comp o: %d, New d: %d, Comp d: %d\n", new->origin, temp->origin, new->dest, temp->dest);
-      if (temp->origin == new->origin || (temp->origin == new->dest && temp->dest == new->origin) || (temp->dest != new->dest && (rightturn(new) || rightturn(temp))))
+      if ((temp->origin == new->origin && temp->dest != new->dest) || (temp->origin == new->dest && temp->dest == new->origin) || (temp->dest != new->dest && (rightturn(new) || rightturn(temp))))
       {
         //kprintf("Everything is fine, continue\n");
         temp = temp->next;