Allow ThreadSafeAutoRefCnt with XPCOM_GLUE

RESOLVED FIXED in Firefox 51

Status

()

Core
XPCOM
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: gerald, Assigned: gerald)

Tracking

(Blocks: 1 bug)

50 Branch
mozilla51
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox51 fixed)

Details

MozReview Requests

()

Submitter Diff Changes Open Issues Last Updated
Loading...
Error loading review requests:

Attachments

(1 attachment)

(Assignee)

Description

2 years ago
As I was trying to introduce some thread-safe ref-counted structures in xpcom/glue, I discovered that three years ago, bug 884061 made thread-safe ref-counting use mozilla::Atomics, which depends on <atomic>, which because of build dependencies then could not be #included from XPCOM_GLUE code; and therefore 'ThreadSafeAutoRefCnt' was forcefully #ifndef'd-out in XPCOM_GLUE code, making thread-safe ref-counting unusable in this case. (See bug 884061 comment 91)

Since it was a long time ago, and that bug didn't get its promised follow-up, and I think Atomics have had some work done, I just tried removing the crippling |#ifndef XPCOM_GLUE|'s and everything compiled just fine:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=d7ffd66645540383e680795138a0d49dadb34055

It's not obvious there, but that try includes my proposed patch https://hg.mozilla.org/try/rev/1ad7e862655a

Also the 'timerutils WIP' patch shows the new code that would not compile otherwise. I'm not sure yet whether that code will be accepted & stay there, so it could all end up being a moot point. Anyway I think we should just get rid of these old limitations if possible, as it has hurt people from the start (bug 884061 comment 90).
Comment hidden (mozreview-request)
(Assignee)

Updated

2 years ago
Attachment #8781737 - Flags: review?(Pidgeot18) → review?(nfroyd)

Comment 2

2 years ago
mozreview-review
Comment on attachment 8781737 [details]
Bug 1295763 - Allow ThreadSafeAutoRefCnt with XPCOM_GLUE -

https://reviewboard.mozilla.org/r/72084/#review72000
Attachment #8781737 - Flags: review?(nfroyd) → review+

Comment 3

2 years ago
Pushed by gsquelart@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b004e438bdc9
Allow ThreadSafeAutoRefCnt with XPCOM_GLUE - r=froydnj

Comment 4

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/b004e438bdc9
Status: NEW → RESOLVED
Last Resolved: 2 years ago
status-firefox51: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla51
You need to log in before you can comment on or make changes to this bug.