Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
8092e181
Commit
8092e181
authored
Sep 09, 2016
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
input/async: add attribute "postponed_exception"
Will replace "postponed_error".
parent
6ed77f2a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
+11
-0
AsyncInputStream.cxx
src/input/AsyncInputStream.cxx
+7
-0
AsyncInputStream.hxx
src/input/AsyncInputStream.hxx
+4
-0
No files found.
src/input/AsyncInputStream.cxx
View file @
8092e181
...
...
@@ -88,6 +88,12 @@ AsyncInputStream::Resume()
bool
AsyncInputStream
::
Check
(
Error
&
error
)
{
if
(
postponed_exception
)
{
auto
e
=
std
::
move
(
postponed_exception
);
postponed_exception
=
std
::
exception_ptr
();
std
::
rethrow_exception
(
e
);
}
bool
success
=
!
postponed_error
.
IsDefined
();
if
(
!
success
)
{
error
=
std
::
move
(
postponed_error
);
...
...
@@ -181,6 +187,7 @@ bool
AsyncInputStream
::
IsAvailable
()
{
return
postponed_error
.
IsDefined
()
||
postponed_exception
||
IsEOF
()
||
!
buffer
.
IsEmpty
();
}
...
...
src/input/AsyncInputStream.hxx
View file @
8092e181
...
...
@@ -26,6 +26,8 @@
#include "util/CircularBuffer.hxx"
#include "util/Error.hxx"
#include <exception>
/**
* Helper class for moving asynchronous (non-blocking) InputStream
* implementations to the I/O thread. Data is being read into a ring
...
...
@@ -67,6 +69,8 @@ class AsyncInputStream : public InputStream {
protected
:
Error
postponed_error
;
std
::
exception_ptr
postponed_exception
;
public
:
/**
* @param _buffer a buffer allocated with HugeAllocate(); the
...
...
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