[bluetooth2] Avoid accessing static variables on different thread

RESOLVED FIXED

Status

Firefox OS
Bluetooth
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: btian, Assigned: btian)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [webbt-api])

Attachments

(6 attachments)

(Assignee)

Description

4 years ago
Bug 1015826 avoids accessing static variables on different thread. The fix should be also applied on bluetooth2.
(Assignee)

Comment 1

4 years ago
Created attachment 8433018 [details] [diff] [review]
Patch 1/6 (v1): [bluetooth2] Remove unneccessary variable sIsBtEnabled to avoid racing issue
Assignee: nobody → btian
Attachment #8433018 - Flags: review?(echou)
(Assignee)

Comment 2

4 years ago
Created attachment 8433019 [details] [diff] [review]
Patch 2/6 (v1): [bluetooth2] Dispatch part of AdapterPropertiesCallback to main thread
Attachment #8433019 - Flags: review?(echou)
(Assignee)

Comment 3

4 years ago
Created attachment 8433020 [details] [diff] [review]
Patch 3/6 (v1): [bluetooth2] Use Atomic on certain primitive variables to ensure thread-safe
Attachment #8433020 - Flags: review?(echou)
(Assignee)

Comment 4

4 years ago
Created attachment 8433022 [details] [diff] [review]
Patch 4/6 (v1): [bluetooth2] Dispatch part of RemoteDevicePropertiesCallback to main thread
Attachment #8433022 - Flags: review?(echou)
(Assignee)

Comment 5

4 years ago
Created attachment 8433023 [details] [diff] [review]
Patch 5/6 (v1): [bluetooth2] Dispatch part of BondStateChangedCallback to main thread
Attachment #8433023 - Flags: review?(echou)
(Assignee)

Comment 6

4 years ago
Created attachment 8433026 [details] [diff] [review]
Patch 6/6 (v1): [bluetooth2] Dispatch part of DiscoveryChangedCallback to main thread
Attachment #8433026 - Flags: review?(echou)
(Assignee)

Updated

4 years ago
Whiteboard: [webbt-api]
(Assignee)

Updated

4 years ago
Blocks: 1019376
Attachment #8433018 - Flags: review?(echou) → review+
Attachment #8433019 - Flags: review?(echou) → review+
Attachment #8433020 - Flags: review?(echou) → review+
Attachment #8433022 - Flags: review?(echou) → review+
Attachment #8433023 - Flags: review?(echou) → review+
Comment on attachment 8433026 [details] [diff] [review]
Patch 6/6 (v1): [bluetooth2] Dispatch part of DiscoveryChangedCallback to main thread

Review of attachment 8433026 [details] [diff] [review]:
-----------------------------------------------------------------

LGTM.
Attachment #8433026 - Flags: review?(echou) → review+
(Assignee)

Comment 8

4 years ago
Set 'checkin-needed' for patch 1 ~ 6.
Keywords: checkin-needed
(Assignee)

Updated

4 years ago
Blocks: 1020300
Do you have a link to a recent Try push handy by chance? :)
Keywords: checkin-needed
(Assignee)

Comment 10

4 years ago
The patches don't affect tpbl result since the affected files are not built yet. They are WIP files for new bluetooth API.
(Assignee)

Comment 11

4 years ago
https://hg.mozilla.org/integration/b2g-inbound/rev/d45fe00e7dcd
https://hg.mozilla.org/integration/b2g-inbound/rev/76fc983a3813
https://hg.mozilla.org/integration/b2g-inbound/rev/73b2cef37ebc
https://hg.mozilla.org/integration/b2g-inbound/rev/1949c7590771
https://hg.mozilla.org/integration/b2g-inbound/rev/97da7dcaf95b
https://hg.mozilla.org/integration/b2g-inbound/rev/39c24d61a1b8
https://hg.mozilla.org/mozilla-central/rev/d45fe00e7dcd
https://hg.mozilla.org/mozilla-central/rev/76fc983a3813
https://hg.mozilla.org/mozilla-central/rev/73b2cef37ebc
https://hg.mozilla.org/mozilla-central/rev/1949c7590771
https://hg.mozilla.org/mozilla-central/rev/97da7dcaf95b
https://hg.mozilla.org/mozilla-central/rev/39c24d61a1b8
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.