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
14namespace apra
15{
17 m_lock(mutex.get())
18{
19 pthread_mutex_lock(&m_lock);
20}
21
22ScopeLock::ScopeLock(pthread_mutex_t &mutex) :
23 m_lock(mutex)
24{
25 pthread_mutex_lock(&m_lock);
26}
27
29{
30 pthread_mutex_unlock(&m_lock);
31}
32}
pthread_mutex_t & m_lock
Definition ScopeLock.h:29
ScopeLock(pthread_mutex_t &mutex)
Definition ScopeLock.cpp:22