]> granicus.if.org Git - pdns/commitdiff
Minimal fix to avoid busy looping. The condition_variable varant showed
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Fri, 10 May 2019 11:45:00 +0000 (13:45 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Fri, 17 May 2019 08:56:31 +0000 (08:56 +0000)
spurious failures on travis so go for the minimial fix.

pdns/communicator.cc

index 7db5a3e5b6737a2368059311400d8bd115e95bf5..7fd59e450e3a33a37818f1c15885cbb27dd771a7 100644 (file)
@@ -136,7 +136,10 @@ void CommunicatorClass::mainloop(void)
           if (extraSlaveRefresh)
             slaveRefresh(&P);
         }
-        else { 
+        else {
+          // eat up extra posts to avoid busy looping if many posts were done
+          while (d_any_sem.tryWait() == 0) {
+          }
           break; // something happened
         }
         // this gets executed at least once every second