All checks were successful
continuous-integration/drone/push Build is passing
Split thread into two different entities. Add exclusive signal.
38 lines
754 B
C++
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_ */
|