F´ Flight Software - C/C++ Documentation
devel
A framework for building embedded system applications to NASA flight quality standards.
Mutex.hpp
Go to the documentation of this file.
1
// ======================================================================
2
// \title Os/Posix/Mutex.hpp
3
// \brief Posix definitions for Os::Mutex
4
// ======================================================================
5
#ifndef OS_POSIX_MUTEX_HPP
6
#define OS_POSIX_MUTEX_HPP
7
#include <pthread.h>
8
#include <
Os/Mutex.hpp
>
9
10
namespace
Os
{
11
namespace
Posix {
12
namespace
Mutex {
13
14
struct
PosixMutexHandle
:
public
MutexHandle
{
15
pthread_mutex_t
m_mutex_descriptor
= PTHREAD_MUTEX_INITIALIZER;
16
};
17
22
class
PosixMutex
:
public
MutexInterface
{
23
public
:
26
PosixMutex
();
27
30
~PosixMutex
()
override
;
31
34
MutexHandle
*
getHandle
()
override
;
35
36
Status
take
()
override
;
37
Status
release
()
override
;
38
39
private
:
41
PosixMutexHandle
m_handle;
42
};
43
44
}
// namespace Mutex
45
}
// namespace Posix
46
}
// namespace Os
47
#endif
// OS_POSIX_MUTEX_HPP
Mutex.hpp
Os::MutexInterface
Definition:
Mutex.hpp:15
Os::MutexInterface::Status
Status
Definition:
Mutex.hpp:17
Os::Posix::Mutex::PosixMutex
Posix implementation of Os::Mutex.
Definition:
Mutex.hpp:22
Os::Posix::Mutex::PosixMutex::~PosixMutex
~PosixMutex() override
destructor
Definition:
Mutex.cpp:31
Os::Posix::Mutex::PosixMutex::PosixMutex
PosixMutex()
constructor
Definition:
Mutex.cpp:13
Os::Posix::Mutex::PosixMutex::release
Status release() override
unlock the mutex and get return status
Definition:
Mutex.cpp:41
Os::Posix::Mutex::PosixMutex::getHandle
MutexHandle * getHandle() override
return the underlying mutex handle (implementation specific)
Definition:
Mutex.cpp:46
Os::Posix::Mutex::PosixMutex::take
Status take() override
lock the mutex and get return status
Definition:
Mutex.cpp:36
Os
Definition:
DirectoryOpenModeEnumAc.cpp:13
Os::MutexHandle
Definition:
Mutex.hpp:13
Os::Posix::Mutex::PosixMutexHandle
Definition:
Mutex.hpp:14
Os::Posix::Mutex::PosixMutexHandle::m_mutex_descriptor
pthread_mutex_t m_mutex_descriptor
Definition:
Mutex.hpp:15
Os
Posix
Mutex.hpp
Generated by
1.9.1