| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | #include "Os/CountingSemaphore.hpp" | ||
| 2 | #include "Fw/Types/Assert.hpp" | ||
| 3 | |||
| 4 | namespace Os { | ||
| 5 | 2581 | CountingSemaphore::CountingSemaphore(U32 initial_count) | |
| 6 |
1/1✓ Branch 9 taken 2581 times.
|
2581 | : m_delegate(*CountingSemaphoreInterface::getDelegate(m_handle_storage, initial_count)) {} |
| 7 | |||
| 8 | 5162 | CountingSemaphore::~CountingSemaphore() { | |
| 9 | 5162 | m_delegate.~CountingSemaphoreInterface(); | |
| 10 | 5162 | } | |
| 11 | |||
| 12 | 1034 | CountingSemaphore::Status CountingSemaphore::wait() { | |
| 13 | 1034 | FW_ASSERT(&this->m_delegate == reinterpret_cast<CountingSemaphoreInterface*>(&this->m_handle_storage[0])); | |
| 14 | 1034 | return this->m_delegate.wait(); | |
| 15 | } | ||
| 16 | |||
| 17 | 8 | CountingSemaphore::Status CountingSemaphore::waitTimeout(const Fw::TimeInterval& interval) { | |
| 18 | 8 | FW_ASSERT(&this->m_delegate == reinterpret_cast<CountingSemaphoreInterface*>(&this->m_handle_storage[0])); | |
| 19 | 8 | return this->m_delegate.waitTimeout(interval); | |
| 20 | } | ||
| 21 | |||
| 22 | 208198 | CountingSemaphore::Status CountingSemaphore::tryWait() { | |
| 23 | 208198 | FW_ASSERT(&this->m_delegate == reinterpret_cast<CountingSemaphoreInterface*>(&this->m_handle_storage[0])); | |
| 24 | 208663 | return this->m_delegate.tryWait(); | |
| 25 | } | ||
| 26 | |||
| 27 | 209892 | CountingSemaphore::Status CountingSemaphore::post() { | |
| 28 | 209892 | FW_ASSERT(&this->m_delegate == reinterpret_cast<CountingSemaphoreInterface*>(&this->m_handle_storage[0])); | |
| 29 | 210131 | return this->m_delegate.post(); | |
| 30 | } | ||
| 31 | |||
| 32 | ✗ | CountingSemaphoreHandle* CountingSemaphore::getHandle() { | |
| 33 | ✗ | FW_ASSERT(&this->m_delegate == reinterpret_cast<const CountingSemaphoreInterface*>(&this->m_handle_storage[0])); | |
| 34 | ✗ | return this->m_delegate.getHandle(); | |
| 35 | } | ||
| 36 | |||
| 37 | } // namespace Os | ||
| 38 |