X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=test%2Flib%2FCluster.cpp;h=de05a79769663e4801866c2c1d4ace41864233b8;hb=4debceb95ebab23b83c7ebcf153bb321d16b4d52;hp=1589e68ccf6906f9f699b4924ba5e00289a0a937;hpb=8af5cd68ad8a83f52ae65fa36bf1dbcf85a64ef9;p=awesomized%2Flibmemcached diff --git a/test/lib/Cluster.cpp b/test/lib/Cluster.cpp index 1589e68c..de05a797 100644 --- a/test/lib/Cluster.cpp +++ b/test/lib/Cluster.cpp @@ -2,7 +2,7 @@ #include "Retry.hpp" #include -#if HAVE_EXECUTION +#if HAVE_EXECUTION && HAVE_TBB # include #endif #include @@ -56,7 +56,7 @@ void Cluster::stop(bool graceful) { bool Cluster::isStopped() { return none_of( -#if HAVE_EXECUTION +#if HAVE_EXECUTION && HAVE_TBB execution::par, #endif cluster.begin(), cluster.end(), [](Server &s) { @@ -66,7 +66,7 @@ bool Cluster::isStopped() { 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) { @@ -79,7 +79,7 @@ bool Cluster::ensureListening() { return false; } auto listening = all_of( -#if HAVE_EXECUTION +#if HAVE_EXECUTION && HAVE_TBB execution::par, #endif cluster.begin(), cluster.end(), [](Server &s) { @@ -98,6 +98,7 @@ void Cluster::wait() { siginfo_t inf; while (!isStopped()) { +#if HAVE_WAITID_NOWAIT if (waitid(P_ALL, 0, &inf, WEXITED | WNOWAIT)) { perror("Cluster::wait waitid()"); return; @@ -107,6 +108,9 @@ void Cluster::wait() { if (server != pids.end()) { server->second->wait(); } +#else + this_thread::sleep_for(100ms); +#endif } }