Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
pistache
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
pistache
Commits
08d49196
Commit
08d49196
authored
May 30, 2016
by
Mathieu STEFANI
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed compilation for gcc 4.7
parent
fc806ccc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
include/async.h
include/async.h
+4
-4
include/transport.h
include/transport.h
+1
-1
No files found.
include/async.h
View file @
08d49196
...
...
@@ -1059,10 +1059,10 @@ namespace Async {
void
wait
()
{
if
(
promise_
.
isFulfilled
()
||
promise_
.
isRejected
())
return
;
promise_
.
then
([
&
](
const
T
&
)
{
promise_
.
then
([
&
](
const
T
&
)
mutable
{
std
::
unique_lock
<
std
::
mutex
>
guard
(
mtx
);
cv
.
notify_one
();
},
[
&
](
std
::
exception_ptr
)
{
},
[
&
](
std
::
exception_ptr
)
mutable
{
std
::
unique_lock
<
std
::
mutex
>
guard
(
mtx
);
cv
.
notify_one
();
});
...
...
@@ -1075,10 +1075,10 @@ namespace Async {
std
::
cv_status
wait_for
(
const
std
::
chrono
::
duration
<
Rep
,
Period
>&
period
)
{
if
(
promise_
.
isFulfilled
()
||
promise_
.
isRejected
())
return
std
::
cv_status
::
no_timeout
;
promise_
.
then
([
&
](
const
T
&
)
{
promise_
.
then
([
&
](
const
T
&
)
mutable
{
std
::
unique_lock
<
std
::
mutex
>
guard
(
mtx
);
cv
.
notify_one
();
},
[
&
](
std
::
exception_ptr
)
{
},
[
&
](
std
::
exception_ptr
)
mutable
{
std
::
unique_lock
<
std
::
mutex
>
guard
(
mtx
);
cv
.
notify_one
();
});
...
...
include/transport.h
View file @
08d49196
...
...
@@ -36,7 +36,7 @@ public:
// it in our own thread so that we make sure that every I/O operation happens in the right thread
const
bool
isInRightThread
=
std
::
this_thread
::
get_id
()
==
io
()
->
thread
();
if
(
!
isInRightThread
)
{
return
Async
::
Promise
<
ssize_t
>
([
=
](
Async
::
Deferred
<
ssize_t
>
deferred
)
{
return
Async
::
Promise
<
ssize_t
>
([
=
](
Async
::
Deferred
<
ssize_t
>
deferred
)
mutable
{
BufferHolder
holder
(
buffer
);
auto
detached
=
holder
.
detach
();
WriteEntry
write
(
std
::
move
(
deferred
),
detached
,
flags
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment