From 8b84e5b3f975e4ad692b7cdcb1b7212b41f25cf1 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 17 Jun 2014 00:52:12 +0200 Subject: input/curl: hold mutex while writing to postponed_error --- src/input/AsyncInputStream.cxx | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/input/AsyncInputStream.cxx') diff --git a/src/input/AsyncInputStream.cxx b/src/input/AsyncInputStream.cxx index 169a9e8e4..f2e0320c4 100644 --- a/src/input/AsyncInputStream.cxx +++ b/src/input/AsyncInputStream.cxx @@ -63,6 +63,16 @@ AsyncInputStream::Pause() paused = true; } +void +AsyncInputStream::PostponeError(Error &&error) +{ + assert(io_thread_inside()); + + seek_state = SeekState::NONE; + postponed_error = std::move(error); + cond.broadcast(); +} + inline void AsyncInputStream::Resume() { -- cgit v1.2.3