mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-12 15:03:34 +08:00
STM32: Proper semaphore destruction in NuttX driver
This commit is contained in:
@@ -45,12 +45,13 @@ public:
|
||||
|
||||
#elif UAVCAN_STM32_NUTTX
|
||||
|
||||
class Event
|
||||
class Event : uavcan::Noncopyable
|
||||
{
|
||||
sem_t sem_;
|
||||
|
||||
public:
|
||||
Event();
|
||||
~Event();
|
||||
|
||||
bool wait(uavcan::MonotonicDuration duration);
|
||||
|
||||
|
||||
@@ -62,6 +62,11 @@ Event::Event()
|
||||
(void)sem_init(&sem_, 0, 0);
|
||||
}
|
||||
|
||||
Event::~Event()
|
||||
{
|
||||
(void)sem_destroy(&sem_);
|
||||
}
|
||||
|
||||
bool Event::wait(uavcan::MonotonicDuration duration)
|
||||
{
|
||||
if (duration.isNegative())
|
||||
|
||||
Reference in New Issue
Block a user