Closed Bug 751423 Opened 8 years ago Closed 8 years ago
Current Switch State is racy
So sSwitchObserver (from hal/gonk/GonkSwitch.cpp) is initialized from the IOThread (EnableSwitchNotificationsIOThread -> InitializeResourceIfNeed ) However, the AudioManager (dom/system/gonk/AudioManager.cpp) calls GetCurrentSwitchState from its constructor, which I'm pretty sure runs in main thread context. At least one crash has been observed during bootup which can be attributed to this (seg fault in GetCurrentSwitchState).
Ugh, review fail. To fix this problem, EnableSwitchNotifications() needs to wait for the IO thread to finish setup, something like http://mxr.mozilla.org/mozilla-central/source/ipc/ril/Ril.cpp#379 . The access to the current switch state is racy but that's actually "OK".
Attachment #620574 - Flags: review?(jones.chris.g) → review+
Target Milestone: --- → ProductDemo
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.