| 36 | } |
| 37 | |
| 38 | void Throttle::PendingCall() |
| 39 | { |
| 40 | m_fn(); |
| 41 | std::lock_guard<std::mutex> lock(m_mutex); |
| 42 | if (m_lastCallTimePoint > m_lastScheduledCallTimePoint) |
| 43 | { |
| 44 | m_lastScheduledCallTimePoint = Clock::now(); |
| 45 | m_executor.CallAt(Clock::now() + m_delta, [this] { PendingCall(); }); |
| 46 | } |
| 47 | else |
| 48 | { |
| 49 | m_callPending = false; |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | } // namespace fusion |