Closed Bug 751423 Opened 8 years ago Closed 8 years ago

GetCurrentSwitchState is racy

Categories

(Firefox OS Graveyard :: General, defect)

ARM
Gonk (Firefox OS)
defect
Not set

Tracking

(Not tracked)

RESOLVED FIXED
ProductDemo

People

(Reporter: dhylands, Assigned: slee)

Details

Attachments

(1 file)

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".
Assignee: nobody → slee
Attachment #620574 - Flags: review?(jones.chris.g)
Attachment #620574 - Flags: review?(jones.chris.g) → review+
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/72a7230e978e
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.