summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorcyy <cyyever@outlook.com>2019-01-16 13:40:46 +0800
committercyy <cyyever@outlook.com>2019-01-22 10:38:14 +0800
commitf7a4ead00d7988e76d2a22758f9e674644582620 (patch)
tree8526ed545e4f3bef0ab52da4b1cf7d9057abce58 /lib
parentf6460fa00b0d9705ad1b88435aebc5aad9f0da7d (diff)
downloadthrift-f7a4ead00d7988e76d2a22758f9e674644582620.tar.gz
fix warings
Diffstat (limited to 'lib')
-rw-r--r--lib/cpp/test/concurrency/TimerManagerTests.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/cpp/test/concurrency/TimerManagerTests.h b/lib/cpp/test/concurrency/TimerManagerTests.h
index 24d829acf..a922826e9 100644
--- a/lib/cpp/test/concurrency/TimerManagerTests.h
+++ b/lib/cpp/test/concurrency/TimerManagerTests.h
@@ -36,7 +36,7 @@ class TimerManagerTests {
public:
class Task : public Runnable {
public:
- Task(Monitor& monitor, int64_t timeout)
+ Task(Monitor& monitor, uint64_t timeout)
: _timeout(timeout),
_startTime(std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now().time_since_epoch()).count()),
_endTime(0),
@@ -72,7 +72,7 @@ public:
* properly clean up itself and the remaining orphaned timeout task when the
* manager goes out of scope and its destructor is called.
*/
- bool test00(int64_t timeout = 1000LL) {
+ bool test00(uint64_t timeout = 1000LL) {
shared_ptr<TimerManagerTests::Task> orphanTask
= shared_ptr<TimerManagerTests::Task>(new TimerManagerTests::Task(_monitor, 10 * timeout));
@@ -94,7 +94,7 @@ public:
Synchronized s(_monitor);
timerManager.add(orphanTask, 10 * timeout);
- THRIFT_SLEEP_USEC(timeout * 1000);
+ std::this_thread::sleep_for(std::chrono::milliseconds(timeout));
task.reset(new TimerManagerTests::Task(_monitor, timeout));
timerManager.add(task, timeout);
@@ -122,7 +122,7 @@ public:
* verifies that the timer manager properly clean up itself and the remaining orphaned timeout
* task when the manager goes out of scope and its destructor is called.
*/
- bool test01(int64_t timeout = 1000LL) {
+ bool test01(uint64_t timeout = 1000LL) {
TimerManager timerManager;
timerManager.threadFactory(shared_ptr<ThreadFactory>(new ThreadFactory()));
timerManager.start();
@@ -155,7 +155,7 @@ public:
* clean up itself and the remaining orphaned timeout task when the manager goes out of scope
* and its destructor is called.
*/
- bool test02(int64_t timeout = 1000LL) {
+ bool test02(uint64_t timeout = 1000LL) {
TimerManager timerManager;
timerManager.threadFactory(shared_ptr<ThreadFactory>(new ThreadFactory()));
timerManager.start();
@@ -188,7 +188,7 @@ public:
* verifies that the timer manager properly clean up itself and the remaining orphaned timeout
* task when the manager goes out of scope and its destructor is called.
*/
- bool test03(int64_t timeout = 1000LL) {
+ bool test03(uint64_t timeout = 1000LL) {
TimerManager timerManager;
timerManager.threadFactory(shared_ptr<ThreadFactory>(new ThreadFactory()));
timerManager.start();
@@ -225,7 +225,7 @@ public:
/**
* This test creates one tasks, and tries to remove it after it has expired.
*/
- bool test04(int64_t timeout = 1000LL) {
+ bool test04(uint64_t timeout = 1000LL) {
TimerManager timerManager;
timerManager.threadFactory(shared_ptr<ThreadFactory>(new ThreadFactory()));
timerManager.start();