Commit 69ed35ed authored by Max Kellermann's avatar Max Kellermann

test/{run_input,dump_text_file}: use class ScopeLock

parent 280d35a0
......@@ -51,17 +51,14 @@ dump_input_stream(InputStreamPtr &&is)
dump_text_file(tis);
}
is->Lock();
const ScopeLock protect(is->mutex);
Error error;
if (!is->Check(error)) {
LogError(error);
is->Unlock();
return EXIT_FAILURE;
}
is->Unlock();
return 0;
}
......
......@@ -49,7 +49,7 @@ tag_save(FILE *file, const Tag &tag)
static int
dump_input_stream(InputStream *is)
{
is->Lock();
const ScopeLock protect(is->mutex);
/* print meta data */
......@@ -84,12 +84,9 @@ dump_input_stream(InputStream *is)
Error error;
if (!is->Check(error)) {
LogError(error);
is->Unlock();
return EXIT_FAILURE;
}
is->Unlock();
return 0;
}
......
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