ApraLinuxUtils
1.0.0
C++ utility library for embedded Linux systems
Loading...
Searching...
No Matches
Mutex.cpp
Go to the documentation of this file.
1
/*
2
* Mutex.cpp
3
*
4
* Copyright (c) 2024 Apra Labs
5
*
6
* This file is part of ApraUtils.
7
*
8
* Licensed under the MIT License.
9
* See LICENSE file in the project root for full license information.
10
*/
11
12
#include "
utils/Mutex.h
"
13
14
namespace
apra
15
{
16
17
Mutex::Mutex
()
18
{
19
pthread_mutex_init(&
m_mutex
, NULL);
20
}
21
Mutex::~Mutex
()
22
{
23
pthread_mutex_destroy(&
m_mutex
);
24
}
25
void
Mutex::lock
()
26
{
27
pthread_mutex_lock(&
m_mutex
);
28
}
29
void
Mutex::unlock
()
30
{
31
pthread_mutex_unlock(&
m_mutex
);
32
}
33
pthread_mutex_t&
Mutex::get
()
34
{
35
return
m_mutex
;
36
}
37
}
/* namespace apra */
38
Mutex.h
apra::Mutex::~Mutex
~Mutex()
Definition
Mutex.cpp:21
apra::Mutex::get
pthread_mutex_t & get()
Definition
Mutex.cpp:33
apra::Mutex::m_mutex
pthread_mutex_t m_mutex
Definition
Mutex.h:28
apra::Mutex::lock
void lock()
Definition
Mutex.cpp:25
apra::Mutex::unlock
void unlock()
Definition
Mutex.cpp:29
apra::Mutex::Mutex
Mutex()
Definition
Mutex.cpp:17
apra
Definition
EventCallbacks.h:16
src
utils
Mutex.cpp
Generated by
1.9.8