|
@@ -116,12 +116,10 @@ static void clearint(car * done)
|
|
|
|
|
|
temp2->next = temp->next;
|
|
|
SKIP1:
|
|
|
-
|
|
|
+
|
|
|
if (temp->cv) // if this car was blocking something
|
|
|
{
|
|
|
- lock_acquire(globlock);
|
|
|
cv_broadcast(temp->cv, globlock); // wake all/inform them you're all good
|
|
|
- lock_release(globlock);
|
|
|
cv_destroy(temp->cv);
|
|
|
}
|
|
|
|
|
@@ -256,6 +254,7 @@ void intersection_before_entry(Direction origin, Direction destination)
|
|
|
|
|
|
void intersection_after_exit(Direction origin, Direction destination)
|
|
|
{
|
|
|
+ lock_acquire(globlock);
|
|
|
car * temp = active->front;
|
|
|
|
|
|
while (temp)
|
|
@@ -270,4 +269,6 @@ void intersection_after_exit(Direction origin, Direction destination)
|
|
|
temp = temp->next;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ lock_release(globlock);
|
|
|
}
|