Explorar o código

trying to not wake all, but do independently

tarfeef101 %!s(int64=6) %!d(string=hai) anos
pai
achega
7bbd784093
Modificáronse 1 ficheiros con 8 adicións e 1 borrados
  1. 8 1
      kern/synchprobs/traffic_synch.c

+ 8 - 1
kern/synchprobs/traffic_synch.c

@@ -120,7 +120,14 @@ static void clearint(car * done)
   
   if (temp->cv) // if this car was blocking something
   {
-    cv_broadcast(temp->cv, globlock); // wake all/inform them you're all good
+    //cv_broadcast(temp->cv, globlock); // wake all/inform them you're all good
+    //cv_destroy(temp->cv);
+    
+    while (!(wchan_is_empty(temp->cv->wc)))
+    {
+      cv_signal(temp->cv, globlock);
+    }
+    
     cv_destroy(temp->cv);
   }