ApraLinuxUtils
1.0.0
C++ utility library for embedded Linux systems
Loading...
Searching...
No Matches
ScopeLock.cpp
Go to the documentation of this file.
1
/*
2
* Synchronization.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/ScopeLock.h
>
13
14
namespace
apra
15
{
16
ScopeLock::ScopeLock
(
Mutex
&mutex) :
17
m_lock(mutex.get())
18
{
19
pthread_mutex_lock(&
m_lock
);
20
}
21
22
ScopeLock::ScopeLock
(pthread_mutex_t &mutex) :
23
m_lock(mutex)
24
{
25
pthread_mutex_lock(&
m_lock
);
26
}
27
28
ScopeLock::~ScopeLock
()
29
{
30
pthread_mutex_unlock(&
m_lock
);
31
}
32
}
ScopeLock.h
apra::Mutex
Definition
Mutex.h:19
apra::ScopeLock::m_lock
pthread_mutex_t & m_lock
Definition
ScopeLock.h:29
apra::ScopeLock::ScopeLock
ScopeLock(pthread_mutex_t &mutex)
Definition
ScopeLock.cpp:22
apra::ScopeLock::~ScopeLock
~ScopeLock()
Definition
ScopeLock.cpp:28
apra
Definition
EventCallbacks.h:16
src
utils
ScopeLock.cpp
Generated by
1.9.8