projects
/
m6w6
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
Merge trunk
[m6w6/libmemcached]
/
libtest
/
wait.h
diff --git
a/libtest/wait.h
b/libtest/wait.h
index 33c4db54cb838d0c707345d2e199b82494deb074..9c0ae79c9d6d5b25fe62222800bf317d61b406cc 100644
(file)
--- a/
libtest/wait.h
+++ b/
libtest/wait.h
@@
-55,14
+55,24
@@
public:
for (waited= 0, retry= 1; ; retry++, waited+= this_wait)
{
for (waited= 0, retry= 1; ; retry++, waited+= this_wait)
{
- if (
(not access(filename.c_str(), R_OK)) or (waited >= timeout)
)
+ if (
access(filename.c_str(), R_OK) == 0
)
{
_successful= true;
break;
}
{
_successful= true;
break;
}
+ else if (waited >= timeout)
+ {
+ break;
+ }
this_wait= retry * retry / 3 + 1;
sleep(this_wait);
this_wait= retry * retry / 3 + 1;
sleep(this_wait);
+#ifdef WIN32
+ sleep(this_wait);
+#else
+ struct timespec global_sleep_value= { this_wait, 0 };
+ nanosleep(&global_sleep_value, NULL);
+#endif
}
}
}
}