projects
/
invirt/third/libt4.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
All sleep calls via std::this_thread
[invirt/third/libt4.git]
/
rpc
/
rpctest.cc
diff --git
a/rpc/rpctest.cc
b/rpc/rpctest.cc
index
051e564
..
0435ab1
100644
(file)
--- a/
rpc/rpctest.cc
+++ b/
rpc/rpctest.cc
@@
-59,7
+59,8
@@
int srv::handle_fast(int & r, const int a) {
}
int srv::handle_slow(int & r, const int a) {
}
int srv::handle_slow(int & r, const int a) {
- usleep(std::uniform_int_distribution<useconds_t>(0,500)(global->random_generator));
+ int us = std::uniform_int_distribution<>(0,500)(global->random_generator);
+ std::this_thread::sleep_for(microseconds(us));
r = a + 2;
return 0;
}
r = a + 2;
return 0;
}
@@
-420,5
+421,5
@@
int main(int argc, char *argv[]) {
}
while (1)
}
while (1)
- usleep(100000);
+ std::this_thread::sleep_for(milliseconds(100));
}
}