skullc-peripherals/Threads/Inc/threads_thread.hpp
Erki 6f7756e1cb
All checks were successful
continuous-integration/drone/push Build is passing
Threads refactor
Split thread into two different entities.
Add exclusive signal.
2021-06-19 19:34:28 +03:00

38 lines
754 B
C++

/*
* tasks_task.hpp
*
* Created on: Mar 18, 2021
* Author: erki
*/
#ifndef SKULLC_THREADS_THREAD_HPP_
#define SKULLC_THREADS_THREAD_HPP_
#include "threads_primitivethread.hpp"
namespace Threads
{
template<typename CRTP>
class Thread : public PrimitiveThread
{
public:
Thread(const char* name, const osPriority_t priority, const std::uint32_t stack_size)
: PrimitiveThread([](void* d) {
CRTP* dd = static_cast<CRTP*>(d);
(*dd)();
}, name, priority, stack_size)
{}
Thread() = delete;
Thread(const Thread&) = delete;
Thread(Thread&&) = delete;
Thread& operator=(const Thread&) = delete;
Thread& operator=(Thread&&) = delete;
};
}// namespace Threads
#endif /* SKULLC_THREADS_THREAD_HPP_ */