/
githubmirror
/
omim
Обзор
Документация
Войти
/
githubmirror
/
omim
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
drape_frontend/drape_notifier.hpp
35 строк
940 B
Maksim Andrianov
Refactored thead pools
29 янв 2019, 17:29
29 янв 2019, 17:29
db2b3db
Код
Авторство
О чём код?
#pragma once #include "drape_frontend/threads_commutator.hpp" #include "drape/pointers.hpp" #include "base/thread_pool_delayed.hpp" #include <atomic> #include <cstdint> #include <functional> namespace df { class DrapeNotifier { public: static uint64_t constexpr kInvalidId = 0; using Functor = std::function<void(uint64_t notifyId)>; explicit DrapeNotifier(ref_ptr<ThreadsCommutator> commutator); uint64_t Notify(ThreadsCommutator::ThreadName threadName, base::thread_pool::delayed::ThreadPool::Duration const & duration, bool repeating, Functor && functor); private: void NotifyImpl(ThreadsCommutator::ThreadName threadName, base::thread_pool::delayed::ThreadPool::Duration const & duration, bool repeating, uint64_t notifyId, Functor && functor); ref_ptr<ThreadsCommutator> m_commutator; std::atomic<uint64_t> m_counter; }; } // namespace df