[bluetooth2] Avoid accessing static variables on different thread

RESOLVED FIXED

Status

RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: ben.tian, Assigned: ben.tian)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [webbt-api])

Attachments

(6 attachments)

(Assignee)

Description

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

Comment 1

5 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

5 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

5 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

5 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

5 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

5 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

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

Updated

5 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

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

Updated

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

Comment 10

5 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.
You need to log in before you can comment on or make changes to this bug.