/
githubmirror
/
omim
Обзор
Документация
Войти
/
githubmirror
/
omim
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
base/base_tests/condition_test.cpp
36 строк
611 B
Maxim Pimenov
Several explicit constructors per the Cppcheck report.
15 апр 2019, 21:01
15 апр 2019, 21:01
1d0428d
Код
Авторство
О чём код?
#include "testing/testing.hpp" #include "base/thread.hpp" #include "base/threaded_list.hpp" #include "base/condition.hpp" #include "base/logging.hpp" #include <memory> struct ConditionThread : public threads::IRoutine { ThreadedList<int> * m_tl; explicit ConditionThread(ThreadedList<int> * tl) : m_tl(tl) {} void Do() { m_tl->Front(true); } }; UNIT_TEST(Condition_Test) { ThreadedList<int> l; threads::Thread t0; t0.Create(std::make_unique<ConditionThread>(&l)); threads::Thread t1; t1.Create(std::make_unique<ConditionThread>(&l)); l.Cancel(); t0.Join(); t1.Join(); }