Sfoglia il codice sorgente

need to have the lock to broadcast

tarfeef101 6 anni fa
parent
commit
a0f263472b
1 ha cambiato i file con 2 aggiunte e 0 eliminazioni
  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);
   }