| commit | 5f6fda778bf35be4cd67363ca0fe40cf710364c3 | [log] [tgz] |
|---|---|---|
| author | Phil Burk <philburk@google.com> | Thu Apr 15 23:40:25 2021 +0000 |
| committer | Phil Burk <philburk@google.com> | Thu Jun 10 14:22:47 2021 -0700 |
| tree | df67601749d5fdc162718da9989864b323e09fdf | |
| parent | 9dd928e100d38c42f68c04c01f09fa8c8cb606d3 [diff] [blame] |
aaudio: unlock when joining the timestamp thread This will prevent a deadlock in case the timestamp thread tries to acquire the same lock. Bug: 182852602 Bug: 153358911 Test: plug and unplug headphones while playing Change-Id: I625d191906c7e280f3a223f476716ef17b9098ea Merged-In: I625d191906c7e280f3a223f476716ef17b9098ea
diff --git a/services/oboeservice/AAudioServiceStreamBase.cpp b/services/oboeservice/AAudioServiceStreamBase.cpp index 32cc7ca..30deb5d 100644 --- a/services/oboeservice/AAudioServiceStreamBase.cpp +++ b/services/oboeservice/AAudioServiceStreamBase.cpp
@@ -338,7 +338,12 @@ setState(AAUDIO_STREAM_STATE_STOPPING); + // Temporarily unlock because we are joining the timestamp thread and it may try + // to acquire mLock. + mLock.unlock(); result = stopTimestampThread(); + mLock.lock(); + if (result != AAUDIO_OK) { disconnect_l(); return result;