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.h
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
#ifndef BOTAN_UTIL_BARRIER_H_
9
#define BOTAN_UTIL_BARRIER_H_
10
11
#include <condition_variable>
12
#include <mutex>
13
14
namespace
Botan
{
15
16
/**
17
Barrier implements a barrier synchronization primitive. wait() will
18
indicate how many threads to synchronize; each thread needing
19
synchronization should call sync(). When sync() returns, the barrier
20
is reset to zero, and the m_syncs counter is incremented. m_syncs is a
21
counter to ensure that wait() can be called after a sync() even if the
22
previously sleeping threads have not awoken.)
23
*/
24
class
Barrier
final
{
25
public
:
26
explicit
Barrier
(
int
value = 0) : m_value(value), m_syncs(0) {}
27
28
void
wait
(
size_t
delta);
29
30
void
sync
();
31
32
private
:
33
size_t
m_value;
34
size_t
m_syncs;
35
std::mutex m_mutex;
36
std::condition_variable m_cond;
37
};
24
class
Barrier
final
{
…
};
38
39
}
// namespace Botan
40
41
#endif
Botan::Barrier
Definition
barrier.h:24
Botan::Barrier::wait
void wait(size_t delta)
Definition
barrier.cpp:12
Botan::Barrier::Barrier
Barrier(int value=0)
Definition
barrier.h:26
Botan::Barrier::sync
void sync()
Definition
barrier.cpp:17
final
int(* final)(unsigned char *, CTX *)
Definition
commoncrypto_hash.cpp:29
Botan
Definition
alg_id.cpp:13
Generated by
1.12.0