GCC Code Coverage Report


Directory: ./
File: Os/DelegateMutex.cpp
Date: 2026-11-03 21:15:54
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 10 taken 10446 times.
10446 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 10446 FW_ASSERT(&this->m_delegate == reinterpret_cast<MutexInterface*>(&this->m_handle_storage[0]));
17 10446 }
18
19 20894 DelegateMutex::~DelegateMutex() {
20 20892 FW_ASSERT(&this->m_delegate == reinterpret_cast<MutexInterface*>(&this->m_handle_storage[0]));
21 20892 m_delegate.~MutexInterface();
22 20894 }
23
24 14 MutexHandle* DelegateMutex::getHandle() {
25 14 FW_ASSERT(&this->m_delegate == reinterpret_cast<MutexInterface*>(&this->m_handle_storage[0]));
26 14 return this->m_delegate.getHandle();
27 }
28
29 9768313 DelegateMutex::Status DelegateMutex::take() {
30 9768313 FW_ASSERT(&this->m_delegate == reinterpret_cast<MutexInterface*>(&this->m_handle_storage[0]));
31 11311490 return this->m_delegate.take();
32 }
33
34 9832068 DelegateMutex::Status DelegateMutex::release() {
35 9832068 FW_ASSERT(&this->m_delegate == reinterpret_cast<MutexInterface*>(&this->m_handle_storage[0]));
36 11379751 return this->m_delegate.release();
37 }
38
39 } // namespace Os
40