Ver Fonte

need to have the lock to broadcast

tarfeef101 há 6 anos atrás
pai
commit
a0f263472b
1 ficheiros alterados com 2 adições e 0 exclusões
  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);
   }