libaudiohal@aidl: Resolve async callbacks concurrency
While the I/O thread is receiving a reply from sending of a 'burst' or 'drain' command, the HAL can already invoke an asynchronous notification. This makes possible to read the current stream state from the last reply in the notification handler before it was updated by 'sendCommand' on the I/O thread. The asynchronous handler needs to "wait" before 'sendCommand' finished. This is achieved by taking the lock which protects access to command and reply queues, as 'sendCommand' only releases when the command handling is done and the last reply was updated. Bug: 363958142 Test: atest CtsMediaAudioTestCases Change-Id: I4d4d94ffc7f093b6716d291a8f705376f079965b
Loading
Please register or sign in to comment