Browse Source

need to have the lock to broadcast

tarfeef101 6 years ago
parent
commit
a0f263472b
1 changed files with 2 additions and 0 deletions
  1. 2 0
      kern/synchprobs/traffic_synch.c

+ 2 - 0
kern/synchprobs/traffic_synch.c

@@ -114,7 +114,9 @@ static void clearint(car * done)
   
   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);
     kfree(temp->cv);
   }