Botan
3.7.1
Crypto and TLS for C&
Toggle main menu visibility
Main Page
Related Pages
Topics
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
z
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
z
Variables
Typedefs
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
Enumerations
a
c
d
e
f
g
h
k
l
m
n
o
p
r
s
t
u
v
w
Enumerator
c
d
f
i
m
n
r
s
t
Concepts
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
y
z
~
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
y
z
~
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
f
h
i
m
n
o
p
r
s
t
u
v
w
Enumerations
b
c
d
e
k
m
n
o
p
s
t
x
Enumerator
_
a
b
c
d
e
f
h
k
l
m
n
p
q
r
s
t
u
w
x
Related Symbols
b
c
d
e
f
k
o
p
s
t
x
Files
File List
File Members
All
_
a
b
c
d
e
f
i
k
m
n
o
p
q
s
t
u
w
x
y
z
Functions
b
c
Variables
Typedefs
b
c
e
p
t
Enumerations
Enumerator
b
c
d
e
k
n
Macros
_
a
b
c
f
m
n
q
s
t
w
src
lib
utils
thread_utils
barrier.cpp
Go to the documentation of this file.
1
/*
2
* Barrier
3
* (C) 2016 Joel Low
4
*
5
* Botan is released under the Simplified BSD License (see license.txt)
6
*/
7
8
#include <botan/internal/barrier.h>
9
10
namespace
Botan
{
11
12
void
Barrier::wait
(
size_t
delta) {
13
std::lock_guard<std::mutex>
lock
(m_mutex);
14
m_value += delta;
15
}
12
void
Barrier::wait
(
size_t
delta) {
…
}
16
17
void
Barrier::sync
() {
18
std::unique_lock<std::mutex>
lock
(m_mutex);
19
20
if
(m_value > 1) {
21
--m_value;
22
const
size_t
current_syncs = m_syncs;
23
m_cond.wait(
lock
, [
this
, ¤t_syncs] {
return
m_syncs != current_syncs; });
24
}
else
{
25
m_value = 0;
26
++m_syncs;
27
m_cond.notify_all();
28
}
29
}
17
void
Barrier::sync
() {
…
}
30
31
}
// namespace Botan
Botan::Barrier::wait
void wait(size_t delta)
Definition
barrier.cpp:12
Botan::Barrier::sync
void sync()
Definition
barrier.cpp:17
Botan
Definition
alg_id.cpp:13
Botan::lock
secure_vector< T > lock(const std::vector< T > &in)
Definition
secmem.h:70
Generated by
1.12.0