Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
Main Page
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
h
i
l
m
n
o
p
r
s
t
u
v
Functions
a
b
c
d
e
f
h
i
l
n
o
p
r
s
t
u
v
Variables
Typedefs
Enumerations
a
c
d
f
h
i
l
m
p
r
s
t
v
Enumerator
a
c
d
f
h
i
l
m
p
r
s
t
u
v
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
~
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
~
Variables
a
b
c
d
e
f
h
i
j
l
m
n
o
p
q
r
s
t
u
w
Typedefs
Enumerations
Enumerator
b
c
d
e
f
i
m
n
q
r
s
x
Files
File List
File Members
All
f
o
r
Functions
Variables
Macros
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
scoped_lock.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2015 Roc Streaming authors
3
*
4
* This Source Code Form is subject to the terms of the Mozilla Public
5
* License, v. 2.0. If a copy of the MPL was not distributed with this
6
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
7
*/
8
9
//! @file roc_core/scoped_lock.h
10
//! @brief RAII mutex lock.
11
12
#ifndef ROC_CORE_SCOPED_LOCK_H_
13
#define ROC_CORE_SCOPED_LOCK_H_
14
15
#include "
roc_core/noncopyable.h
"
16
17
namespace
roc
{
18
namespace
core {
19
20
//! RAII mutex lock.
21
template
<
class
Mutex>
class
ScopedLock
:
NonCopyable
<> {
22
public
:
23
//! Lock.
24
explicit
ScopedLock
(
const
Mutex
& mutex)
25
: mutex_(mutex) {
26
mutex_.
lock
();
27
}
28
29
//! Unlock.
30
~ScopedLock
() {
31
mutex_.
unlock
();
32
}
33
34
private
:
35
const
Mutex
& mutex_;
36
};
37
38
}
// namespace core
39
}
// namespace roc
40
41
#endif
// ROC_CORE_SCOPED_LOCK_H_
roc::core::Mutex
Mutex.
Definition:
mutex.h:31
roc::core::Mutex::unlock
void unlock() const
Unlock mutex.
Definition:
mutex.h:61
roc::core::Mutex::lock
void lock() const
Lock mutex.
Definition:
mutex.h:54
roc::core::NonCopyable
Base class for non-copyable objects.
Definition:
noncopyable.h:23
roc::core::ScopedLock
RAII mutex lock.
Definition:
scoped_lock.h:21
roc::core::ScopedLock::~ScopedLock
~ScopedLock()
Unlock.
Definition:
scoped_lock.h:30
roc::core::ScopedLock::ScopedLock
ScopedLock(const Mutex &mutex)
Lock.
Definition:
scoped_lock.h:24
roc
Root namespace.
noncopyable.h
Non-copyable object.
roc_core
scoped_lock.h
Generated by
1.9.1