#include "Retry.hpp"
#include <algorithm>
-#if HAVE_EXECUTION
+#if HAVE_EXECUTION && HAVE_TBB
# include <execution>
#endif
#include <sys/wait.h>
bool Cluster::isStopped() {
return none_of(
-#if HAVE_EXECUTION
+#if HAVE_EXECUTION && HAVE_TBB
execution::par,
#endif
cluster.begin(), cluster.end(), [](Server &s) {
bool Cluster::isListening() const {
return all_of(
-#if HAVE_EXECUTION
+#if HAVE_EXECUTION && HAVE_TBB
execution::par,
#endif
cluster.begin(), cluster.end(), [](const Server &s) {
return false;
}
auto listening = all_of(
-#if HAVE_EXECUTION
+#if HAVE_EXECUTION && HAVE_TBB
execution::par,
#endif
cluster.begin(), cluster.end(), [](Server &s) {
siginfo_t inf;
while (!isStopped()) {
+#if HAVE_WAITID_NOWAIT
if (waitid(P_ALL, 0, &inf, WEXITED | WNOWAIT)) {
perror("Cluster::wait waitid()");
return;
if (server != pids.end()) {
server->second->wait();
}
+#else
+ this_thread::sleep_for(100ms);
+#endif
}
}