Closed Bug 1658776 Opened 4 years ago Closed 2 years ago

EventSource's locking regime is inconsistent

Categories

(Core :: DOM: Networking, defect, P2)

defect

Tracking

()

RESOLVED FIXED

People

(Reporter: ytausky, Assigned: jstutte)

References

Details

(Whiteboard: [necko-triaged])

Attachments

(2 obsolete files)

EventSource's implementation has a mutex with a very wrong comment attached to it. Several other members of both EventSource and EventSourceImpl are potentially accessed from two different threads and usage of the mutex is inconsistent.

Assignee: nobody → ytausky
Blocks: 1619923
Severity: -- → S3
Priority: -- → P2
Whiteboard: [necko-triaged]
Flags: needinfo?(jstutte)
Flags: needinfo?(jstutte)

Some code in EventSource's implementation was accessing data
members of the DOM object's base class DOMEventTargetHelper from
the main thread, event though that class is not thread-safe. This
commit makes those accesses happen only if the DOM object was
created on the main thread.

Note that there are still other data races in EventSource's
implementation; those will be fixed in subsequent patches.

With this commit a few of EventSource's and EventSourceImpl's data
members are now atomic, since a mutex isn't really necessary for
their use case. Also, several data members are now marked const.

Depends on D101163

Comment on attachment 9196069 [details]
Bug 1658776 - Remove some potential data races r=asuth,#dom-workers-and-storage-reviewers

Revision D101163 was moved to bug 1682928. Setting attachment 9196069 [details] to obsolete.

Attachment #9196069 - Attachment is obsolete: true

Comment on attachment 9196135 [details]
Bug 1658776 - Make some data members atomic or const r=asuth,#dom-workers-and-storage-reviewers

Revision D101210 was moved to bug 1682928. Setting attachment 9196135 [details] to obsolete.

Attachment #9196135 - Attachment is obsolete: true
Assignee: ytausky → jstutte

Hi Randell, would you want to give this a look? Thanks!

Flags: needinfo?(rjesup)

patches were landed on another bug

Status: NEW → RESOLVED
Closed: 2 years ago
Flags: needinfo?(rjesup)
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: