зеркало из https://github.com/mozilla/cubeb.git
AAudio: Don't unlock a mutex owned by a lock_guard
This commit is contained in:
Родитель
b9af56cee7
Коммит
4ae9d45de2
|
@ -1259,14 +1259,14 @@ aaudio_stream_init(cubeb * ctx, cubeb_stream ** stream,
|
|||
|
||||
// This is ok: the thread is marked as being in use
|
||||
lock.unlock();
|
||||
lock_guard guard(stm->mutex);
|
||||
int err;
|
||||
|
||||
{
|
||||
lock_guard guard(stm->mutex);
|
||||
err = aaudio_stream_init_impl(stm, guard);
|
||||
}
|
||||
|
||||
int err = aaudio_stream_init_impl(stm, guard);
|
||||
if (err != CUBEB_OK) {
|
||||
// This is needed since aaudio_stream_destroy will lock the mutex again.
|
||||
// It's no problem that there is a gap in between as the stream isn't
|
||||
// actually in use.
|
||||
lock.unlock();
|
||||
aaudio_stream_destroy(stm);
|
||||
return err;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче