Threads: fix actor and signal requirements
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Trivially copyable and default constructible should be sufficient, as it
allows for memcpy and a T{} ctor.
This commit is contained in:
parent
f456464f6c
commit
15652f7347
@ -26,7 +26,7 @@ class Actor
|
|||||||
public:
|
public:
|
||||||
using value_type = T;
|
using value_type = T;
|
||||||
|
|
||||||
static_assert(std::is_trivially_constructible_v<value_type>, "T must be trivially constructible.");
|
static_assert(std::is_default_constructible_v<value_type>, "T must be default constructible.");
|
||||||
static_assert(std::is_trivially_copyable_v<value_type>, "T must be trivially copyable.");
|
static_assert(std::is_trivially_copyable_v<value_type>, "T must be trivially copyable.");
|
||||||
|
|
||||||
Actor(const std::uint32_t queue_size, const char* name, const osPriority_t priority, const std::uint32_t stack_size)
|
Actor(const std::uint32_t queue_size, const char* name, const osPriority_t priority, const std::uint32_t stack_size)
|
||||||
@ -57,7 +57,7 @@ private:
|
|||||||
{
|
{
|
||||||
init();
|
init();
|
||||||
|
|
||||||
value_type data;
|
value_type data{};
|
||||||
|
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -20,7 +20,8 @@ struct Signallable
|
|||||||
{
|
{
|
||||||
using value_type = T;
|
using value_type = T;
|
||||||
|
|
||||||
static_assert(std::is_trivially_constructible_v<value_type>, "T must be trivially constructible.");
|
static_assert(std::is_trivially_copyable_v<value_type>, "T must be trivially copyable.");
|
||||||
|
static_assert(std::is_default_constructible_v<value_type>, "T must be default constructible.");
|
||||||
|
|
||||||
virtual bool emit(const T& t) = 0;
|
virtual bool emit(const T& t) = 0;
|
||||||
virtual std::pair<bool, BaseType_t> emitFromIsr(const T& t) = 0;
|
virtual std::pair<bool, BaseType_t> emitFromIsr(const T& t) = 0;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user