Floss: access message_loop_thread_ only via worker thread
|RepeatingTimer|s hold a weak pointer to the static worker thread |btif_a2dp_source_thread|, and is only meant to dereference it on the same thread (as the worker thread). However, there is much of abusing its ownership, trying to dereference it from either the main thread or uipc thread, for the sake of using it as a condition to determine if audio is streaming. This alone is prone to race conditions, and causes immediate crashes thrown by libchrome. In this CL, we ensure dereference of the weak pointer in question is only invoked via the worker thread: - Let |btif_a2dp_source_audio_tx_stop_event|, the worker thread function, decide if it |is_streaming| - Remove redundant calls to |media_alarm.IsScheduled| - Remove |is_streaming| checks that are not necessary Bug: 257166696 Tag: #floss Test: Build and verify Change-Id: Ibdfa24ce10b254b8ac5717b7ca64e95bf933f832
Loading
Please register or sign in to comment