File tree 2 files changed +6
-6
lines changed
2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ const size_t kReservedSizeForEvents = 20;
45
45
AsioEventDispatcher::AsioEventDispatcher (QObject* parent)
46
46
: QAbstractEventDispatcher(parent),
47
47
work_guard_ (asio::make_work_guard(io_context_)),
48
- high_resolution_timer_ (io_context_)
48
+ timer_ (io_context_)
49
49
{
50
50
LOG (LS_INFO) << " Ctor" ;
51
51
@@ -315,8 +315,8 @@ void AsioEventDispatcher::asyncWaitForNextTimer()
315
315
const int next_timer_id = next_expire_timer->second .timer_id ;
316
316
317
317
// Start waiting for the timer.
318
- high_resolution_timer_ .expires_at (next_expire_timer->second .expire_time );
319
- high_resolution_timer_ .async_wait ([this , next_timer_id](const std::error_code& error_code)
318
+ timer_ .expires_at (next_expire_timer->second .expire_time );
319
+ timer_ .async_wait ([this , next_timer_id](const std::error_code& error_code)
320
320
{
321
321
if (error_code || interrupted_.load (std::memory_order_relaxed))
322
322
return ;
Original file line number Diff line number Diff line change 24
24
#include < QAbstractEventDispatcher>
25
25
26
26
#include < asio/io_context.hpp>
27
- #include < asio/high_resolution_timer .hpp>
27
+ #include < asio/steady_timer .hpp>
28
28
29
29
#include < atomic>
30
30
#include < unordered_map>
@@ -64,7 +64,7 @@ class AsioEventDispatcher final : public QAbstractEventDispatcher
64
64
asio::io_context& ioContext ();
65
65
66
66
private:
67
- using Clock = std::chrono::high_resolution_clock ;
67
+ using Clock = std::chrono::steady_clock ;
68
68
using TimePoint = Clock::time_point;
69
69
using Milliseconds = std::chrono::milliseconds;
70
70
@@ -97,7 +97,7 @@ class AsioEventDispatcher final : public QAbstractEventDispatcher
97
97
asio::executor_work_guard<asio::io_context::executor_type> work_guard_;
98
98
std::atomic_bool interrupted_ { false };
99
99
std::unordered_map<int , TimerData> timers_;
100
- asio::high_resolution_timer high_resolution_timer_ ;
100
+ asio::steady_timer timer_ ;
101
101
102
102
DISALLOW_COPY_AND_ASSIGN (AsioEventDispatcher);
103
103
};
You can’t perform that action at this time.
0 commit comments