From 459a7d66b39e7a9fb628f93393550545bb5bb6b6 Mon Sep 17 00:00:00 2001 From: fasiondog Date: Thu, 19 May 2022 00:25:08 +0800 Subject: [PATCH] =?UTF-8?q?fixed=20TimerManager=20=E5=9C=A8=E6=9C=AA=20sta?= =?UTF-8?q?rt=20=E4=B9=8B=E5=89=8D=E5=8A=A0=E5=85=A5=E5=AE=9A=E6=97=B6?= =?UTF-8?q?=E5=99=A8=E6=97=B6=E5=87=BA=E7=8E=B0=E9=87=8D=E5=A4=8D=E7=9A=84?= =?UTF-8?q?=E5=AE=9A=E6=97=B6=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hikyuu_cpp/hikyuu/utilities/TimerManager.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hikyuu_cpp/hikyuu/utilities/TimerManager.h b/hikyuu_cpp/hikyuu/utilities/TimerManager.h index 3d7512690..cd8f5dabf 100644 --- a/hikyuu_cpp/hikyuu/utilities/TimerManager.h +++ b/hikyuu_cpp/hikyuu/utilities/TimerManager.h @@ -55,6 +55,8 @@ class TimerManager { /** 启动调度, 可在停止后重新启动 */ void start() { + std::priority_queue new_queue; + m_queue.swap(new_queue); if (m_stop) { m_stop = false; if (!m_tg) { @@ -348,7 +350,7 @@ class TimerManager { s.m_time_point > today + timer->m_end_time) { s.m_time_point = today + timer->m_start_time + TimeDelta(1); } - HKU_TRACE("s.m_time_point: {}", s.m_time_point.repr()); + // HKU_TRACE("s.m_time_point: {}", s.m_time_point.repr()); m_queue.push(s); } }