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
a5c09f4d
Commit
a5c09f4d
authored
May 16, 2019
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
input/buffering: destruct our input while mutex is unlocked
parent
1acb9bce
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
BufferingInputStream.cxx
src/input/BufferingInputStream.cxx
+10
-1
No files found.
src/input/BufferingInputStream.cxx
View file @
a5c09f4d
...
@@ -196,7 +196,6 @@ BufferingInputStream::RunThread() noexcept
...
@@ -196,7 +196,6 @@ BufferingInputStream::RunThread() noexcept
size_t
new_offset
=
FindFirstHole
();
size_t
new_offset
=
FindFirstHole
();
if
(
new_offset
==
INVALID_OFFSET
)
{
if
(
new_offset
==
INVALID_OFFSET
)
{
/* the file has been read completely */
/* the file has been read completely */
input
.
reset
();
break
;
break
;
}
}
...
@@ -251,4 +250,14 @@ BufferingInputStream::RunThread() noexcept
...
@@ -251,4 +250,14 @@ BufferingInputStream::RunThread() noexcept
}
else
}
else
wake_cond
.
wait
(
lock
);
wake_cond
.
wait
(
lock
);
}
}
/* clear the "input" attribute while holding the mutex */
auto
_input
=
std
::
move
(
input
);
/* the mutex must be unlocked while an InputStream can be
destructed */
lock
.
unlock
();
/* and now actually destruct the InputStream */
_input
.
reset
();
}
}
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