diff options
author | MacroFake <falke.marco@gmail.com> | 2022-04-30 09:19:28 +0200 |
---|---|---|
committer | MacroFake <falke.marco@gmail.com> | 2022-04-30 09:17:17 +0200 |
commit | fa4652ce5995ace831b6a4d3125bfcac9563ff6f (patch) | |
tree | e2720b4bad6828fa3f010320fe76695fea39159f /src/scheduler.cpp | |
parent | 26296eba3dc34043b025bda167386c47693705b5 (diff) |
Pass lifetimebound reference to SingleThreadedSchedulerClient
Diffstat (limited to 'src/scheduler.cpp')
-rw-r--r-- | src/scheduler.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/scheduler.cpp b/src/scheduler.cpp index 197d009f7c..3e7ee7d370 100644 --- a/src/scheduler.cpp +++ b/src/scheduler.cpp @@ -143,7 +143,7 @@ void SingleThreadedSchedulerClient::MaybeScheduleProcessQueue() if (m_are_callbacks_running) return; if (m_callbacks_pending.empty()) return; } - m_pscheduler->schedule(std::bind(&SingleThreadedSchedulerClient::ProcessQueue, this), std::chrono::system_clock::now()); + m_scheduler.schedule([this] { this->ProcessQueue(); }, std::chrono::system_clock::now()); } void SingleThreadedSchedulerClient::ProcessQueue() @@ -179,8 +179,6 @@ void SingleThreadedSchedulerClient::ProcessQueue() void SingleThreadedSchedulerClient::AddToProcessQueue(std::function<void()> func) { - assert(m_pscheduler); - { LOCK(m_callbacks_mutex); m_callbacks_pending.emplace_back(std::move(func)); @@ -190,7 +188,7 @@ void SingleThreadedSchedulerClient::AddToProcessQueue(std::function<void()> func void SingleThreadedSchedulerClient::EmptyQueue() { - assert(!m_pscheduler->AreThreadsServicingQueue()); + assert(!m_scheduler.AreThreadsServicingQueue()); bool should_continue = true; while (should_continue) { ProcessQueue(); |