Added return value to addThread

This commit is contained in:
dario 2024-01-18 13:24:31 +01:00
parent 26876a9d99
commit 2eb4705ae6

View File

@ -68,9 +68,13 @@ namespace sta
* @ingroup tacos_api * @ingroup tacos_api
*/ */
template<typename T, typename ... Args> template<typename T, typename ... Args>
void addThread(std::list<uint16_t> states, Args ... args) std::shared_ptr<T> addThread(std::list<uint16_t> states, Args ... args)
{ {
Manager::instance()->registerThread(std::make_shared<T>(args...), states); std::shared_ptr<T> thread_ptr = std::make_shared<T>(args...);
Manager::instance()->registerThread(thread_ptr, states);
return thread_ptr;
} }
} // namespace tacos } // namespace tacos
} }