preCICE
v3.2.0
Toggle main menu visibility
Main Page
Related Pages
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
Functions
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
Variables
_
a
b
c
d
e
f
h
i
m
n
p
r
s
t
Typedefs
b
d
e
g
l
m
p
r
s
t
u
v
Enumerations
Enumerator
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
k
l
m
n
o
p
q
r
s
t
u
v
w
x
~
Variables
_
a
b
c
d
e
f
g
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Typedefs
a
b
c
d
e
f
i
k
m
n
o
p
r
s
t
v
w
Enumerations
Enumerator
c
d
e
i
l
m
n
o
r
s
u
v
w
Related Symbols
Files
File List
File Members
All
_
a
b
c
d
e
g
i
j
m
n
o
p
r
s
t
v
Functions
a
b
c
g
m
p
r
s
t
v
Variables
Typedefs
Macros
b
d
m
n
p
t
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
Loading...
Searching...
No Matches
src
com
SocketRequest.cpp
Go to the documentation of this file.
1
#include "
SocketRequest.hpp
"
2
3
namespace
precice::com
{
4
5
void
SocketRequest::complete
()
6
{
7
{
8
std::lock_guard<std::mutex>
lock(
_completeMutex
);
9
10
_complete
=
true
;
11
}
12
13
_completeCondition
.
notify_one
();
14
}
5
void
SocketRequest::complete
() {
…
}
15
16
bool
SocketRequest::test
()
17
{
18
std::lock_guard<std::mutex>
lock(
_completeMutex
);
19
20
return
_complete
;
21
}
16
bool
SocketRequest::test
() {
…
}
22
23
void
SocketRequest::wait
()
24
{
25
std::unique_lock<std::mutex>
lock(
_completeMutex
);
26
27
// Lock is acquired when the predicate is evaluated.
28
_completeCondition
.
wait
(lock, [
this
] {
return
_complete
; });
29
}
23
void
SocketRequest::wait
() {
…
}
30
}
// namespace precice::com
SocketRequest.hpp
precice::com::SocketRequest::complete
void complete()
Definition
SocketRequest.cpp:5
precice::com::SocketRequest::_completeMutex
std::mutex _completeMutex
Definition
SocketRequest.hpp:20
precice::com::SocketRequest::wait
void wait() override
Definition
SocketRequest.cpp:23
precice::com::SocketRequest::_completeCondition
std::condition_variable _completeCondition
Definition
SocketRequest.hpp:19
precice::com::SocketRequest::_complete
bool _complete
Definition
SocketRequest.hpp:17
precice::com::SocketRequest::test
bool test() override
Definition
SocketRequest.cpp:16
std::lock_guard
precice::com
contains the data communication abstraction layer.
Definition
Communication.cpp:12
std::condition_variable::notify_one
T notify_one(T... args)
std::unique_lock
std::condition_variable::wait
T wait(T... args)