playlist/SoundCloud: use ScopeLock

This commit is contained in:
Max Kellermann 2016-09-09 17:57:49 +02:00
parent 33b70567c8
commit c155df5d79

View File

@ -242,7 +242,7 @@ soundcloud_parse_json(const char *url, yajl_handle hand,
return -1; return -1;
} }
mutex.lock(); const ScopeLock protect(mutex);
yajl_status stat; yajl_status stat;
int done = 0; int done = 0;
@ -259,7 +259,6 @@ soundcloud_parse_json(const char *url, yajl_handle hand,
if (input_stream->IsEOF()) { if (input_stream->IsEOF()) {
done = true; done = true;
} else { } else {
mutex.unlock();
return -1; return -1;
} }
} }
@ -277,8 +276,6 @@ soundcloud_parse_json(const char *url, yajl_handle hand,
} }
} }
mutex.unlock();
return 0; return 0;
} }