STM32: Proper semaphore destruction in NuttX driver

This commit is contained in:
Pavel Kirienko
2014-05-08 11:37:45 +04:00
parent 7f6ef17b18
commit 09ac68bffd
2 changed files with 7 additions and 1 deletions
@@ -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())