fprime/Os/Posix/DefaultMutex.cpp
kevin-f-ortega b36933af55
Update mutex and condition-variable interface (#3158)
* Adhering to new mutex api

* casting assert arg as expected

* Using correct mutex call

* Formatting

* Fixing interface for wait/pend

* Fixing conditionvariable to adhere to new interface

* Updated Os::Stub's implementation of ConditionVariable per new interface

* Formatting and updating Test's ConditionVariable implementation to the new API

* bugfix to ut

* Fixes per PR review.
2025-01-27 14:20:58 -08:00

26 lines
1.2 KiB
C++

// ======================================================================
// \title Os/Posix/DefaultMutex.cpp
// \brief sets default Os::Mutex Posix implementation via linker
// ======================================================================
#include "Os/Delegate.hpp"
#include "Os/Posix/ConditionVariable.hpp"
#include "Os/Posix/Mutex.hpp"
namespace Os {
//! \brief get a delegate for MutexInterface that intercepts calls for Posix
//! \param aligned_new_memory: aligned memory to fill
//! \return: pointer to delegate
MutexInterface* MutexInterface::getDelegate(MutexHandleStorage& aligned_new_memory) {
return Os::Delegate::makeDelegate<MutexInterface, Os::Posix::Mutex::PosixMutex>(aligned_new_memory);
}
//! \brief get a delegate for MutexInterface that intercepts calls for Posix
//! \param aligned_new_memory: aligned memory to fill
//! \return: pointer to delegate
ConditionVariableInterface* ConditionVariableInterface::getDelegate(
ConditionVariableHandleStorage& aligned_new_memory) {
return Os::Delegate::makeDelegate<ConditionVariableInterface, Os::Posix::Mutex::PosixConditionVariable,
ConditionVariableHandleStorage>(aligned_new_memory);
}
} // namespace Os