projects
/
awesomized
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
p9y: fix TCP constants
[awesomized/libmemcached]
/
test
/
lib
/
Cluster.cpp
diff --git
a/test/lib/Cluster.cpp
b/test/lib/Cluster.cpp
index 1186077b2b945187a4042041b00b211e399789b2..de05a79769663e4801866c2c1d4ace41864233b8 100644
(file)
--- a/
test/lib/Cluster.cpp
+++ b/
test/lib/Cluster.cpp
@@
-2,6
+2,9
@@
#include "Retry.hpp"
#include <algorithm>
#include "Retry.hpp"
#include <algorithm>
+#if HAVE_EXECUTION && HAVE_TBB
+# include <execution>
+#endif
#include <sys/wait.h>
Cluster::Cluster(Server serv, size_t cnt)
#include <sys/wait.h>
Cluster::Cluster(Server serv, size_t cnt)
@@
-53,7
+56,7
@@
void Cluster::stop(bool graceful) {
bool Cluster::isStopped() {
return none_of(
bool Cluster::isStopped() {
return none_of(
-#if HAVE_EXECUTION
+#if HAVE_EXECUTION
&& HAVE_TBB
execution::par,
#endif
cluster.begin(), cluster.end(), [](Server &s) {
execution::par,
#endif
cluster.begin(), cluster.end(), [](Server &s) {
@@
-63,10
+66,10
@@
bool Cluster::isStopped() {
bool Cluster::isListening() const {
return all_of(
bool Cluster::isListening() const {
return all_of(
-#if HAVE_EXECUTION
+#if HAVE_EXECUTION
&& HAVE_TBB
execution::par,
#endif
execution::par,
#endif
- cluster.
cbegin(), cluster.c
end(), [](const Server &s) {
+ cluster.
begin(), cluster.
end(), [](const Server &s) {
return s.isListening();
});
}
return s.isListening();
});
}
@@
-76,7
+79,7
@@
bool Cluster::ensureListening() {
return false;
}
auto listening = all_of(
return false;
}
auto listening = all_of(
-#if HAVE_EXECUTION
+#if HAVE_EXECUTION
&& HAVE_TBB
execution::par,
#endif
cluster.begin(), cluster.end(), [](Server &s) {
execution::par,
#endif
cluster.begin(), cluster.end(), [](Server &s) {
@@
-95,6
+98,7
@@
void Cluster::wait() {
siginfo_t inf;
while (!isStopped()) {
siginfo_t inf;
while (!isStopped()) {
+#if HAVE_WAITID_NOWAIT
if (waitid(P_ALL, 0, &inf, WEXITED | WNOWAIT)) {
perror("Cluster::wait waitid()");
return;
if (waitid(P_ALL, 0, &inf, WEXITED | WNOWAIT)) {
perror("Cluster::wait waitid()");
return;
@@
-104,6
+108,9
@@
void Cluster::wait() {
if (server != pids.end()) {
server->second->wait();
}
if (server != pids.end()) {
server->second->wait();
}
+#else
+ this_thread::sleep_for(100ms);
+#endif
}
}
}
}