diff options
author | Max Kellermann <max@musicpd.org> | 2017-01-03 10:53:20 +0100 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2017-01-03 10:53:20 +0100 |
commit | 4397fe3a13add8517a2d35702c8d56a79f3af282 (patch) | |
tree | 974d2818f911a8cf04e9b534245cd39ee871f119 | |
parent | 534e1fa6eb32c0b22b86e6e803408593bbe42e28 (diff) |
input/curl: fold input_curl_easy_add_indirect() into the only caller
-rw-r--r-- | src/input/plugins/CurlInputPlugin.cxx | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/src/input/plugins/CurlInputPlugin.cxx b/src/input/plugins/CurlInputPlugin.cxx index ad03ffc58..b76de8ec6 100644 --- a/src/input/plugins/CurlInputPlugin.cxx +++ b/src/input/plugins/CurlInputPlugin.cxx @@ -177,23 +177,6 @@ CurlInputStream::DoResume() mutex.lock(); } -/** - * Call input_curl_easy_add() in the I/O thread. May be called from - * any thread. Caller must not hold a mutex. - * - * Throws std::runtime_error on error. - */ -static void -input_curl_easy_add_indirect(CurlInputStream *c) -{ - assert(c != nullptr); - assert(c->easy); - - BlockingCall(io_thread_get(), [c](){ - curl_global->Add(c->easy.Get(), *c); - }); -} - void CurlInputStream::FreeEasy() { @@ -546,7 +529,9 @@ CurlInputStream::Open(const char *url, Mutex &mutex, Cond &cond) try { c->InitEasy(); - input_curl_easy_add_indirect(c); + BlockingCall(io_thread_get(), [c](){ + curl_global->Add(c->easy.Get(), *c); + }); } catch (...) { delete c; throw; |