GCC Code Coverage Report


Directory: ./
File: Os/DelegateMutex.cpp
Date: 2026-10-14 22:11:56
Exec Total Coverage
Lines: 16 16 100.0%
Functions: 5 5 100.0%
Branches: 1 1 100.0%

Line Branch Exec Source
1 // ======================================================================
2 // \title Os/DelegateMutex.cpp
3 // \brief implementation of Os::DelegateMutex (link-time delegating Os::Mutex)
4 // ======================================================================
5 #include <Fw/Types/Assert.hpp>
6 #include <Os/DelegateMutex.hpp>
7
8 namespace Os {
9
10 // ----------------------------------------------------------------------
11 // DelegateMutex: link-time delegating implementation
12 // ----------------------------------------------------------------------
13
14
1/1
✓ Branch 2 taken 81 times.
81 DelegateMutex::DelegateMutex() : m_delegate(*MutexInterface::getDelegate(m_handle_storage)) {
15 // m_handle_storage is placement-new storage populated by getDelegate(); do not value-initialize it (#5297)
16 81 FW_ASSERT(&this->m_delegate == reinterpret_cast<MutexInterface*>(&this->m_handle_storage[0]));
17 81 }
18
19 162 DelegateMutex::~DelegateMutex() {
20 162 FW_ASSERT(&this->m_delegate == reinterpret_cast<MutexInterface*>(&this->m_handle_storage[0]));
21 162 m_delegate.~MutexInterface();
22 162 }
23
24 5118 MutexHandle* DelegateMutex::getHandle() {
25 5118 FW_ASSERT(&this->m_delegate == reinterpret_cast<MutexInterface*>(&this->m_handle_storage[0]));
26 5118 return this->m_delegate.getHandle();
27 }
28
29 43629 DelegateMutex::Status DelegateMutex::take() {
30 43629 FW_ASSERT(&this->m_delegate == reinterpret_cast<MutexInterface*>(&this->m_handle_storage[0]));
31 43629 return this->m_delegate.take();
32 }
33
34 43532 DelegateMutex::Status DelegateMutex::release() {
35 43532 FW_ASSERT(&this->m_delegate == reinterpret_cast<MutexInterface*>(&this->m_handle_storage[0]));
36 43532 return this->m_delegate.release();
37 }
38
39 } // namespace Os
40