Currently there's a mutex to protect access to finished_source_handlers_ from the main thread and the audio thread. Since this mutex can happen in the audio thread, there's a potential for blocking the audio thread.
Maybe we can simplify this by removing this mutex and adding a new variable. The audio thread can update finished_source_handlers_ in the audio thread. In the post render task, finished_source_handlers can be appended to a new variable. Since there's a trylock, this new variable won't be updated if the main thread is accessing it. If the lock succeeds, the copy can proceed and finished_source_handlers_ can be cleared safely. It's ok to skip the copy since it will get picked up next time around.
Comment 1 by sheriffbot@chromium.org
, Aug 6Status: Untriaged (was: Available)