Commit 3143dbf3 authored by Max Kellermann's avatar Max Kellermann

input/Open: use ScopeLock

parent 38d587aa
...@@ -67,10 +67,13 @@ InputStream::OpenReady(const char *uri, ...@@ -67,10 +67,13 @@ InputStream::OpenReady(const char *uri,
if (is == nullptr) if (is == nullptr)
return nullptr; return nullptr;
mutex.lock(); bool success;
{
const ScopeLock protect(mutex);
is->WaitReady(); is->WaitReady();
bool success = is->Check(error); success = is->Check(error);
mutex.unlock(); }
if (!success) if (!success)
is.reset(); is.reset();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment