Remove AutoEnter
Categories
(Core :: XPCOM, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox77 | --- | fixed |
People
(Reporter: jya, Assigned: jya)
References
Details
Attachments
(9 files)
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review |
AbstractThread::AutoEnter was added in bug 1364821 has a work around conflicts between the main-thread AbstractThread and the MessageLoopAbstractThreadWrapper that happened to get initialized from the main thread.
MessageLoopAbstractThreadWrapper was set the AbstractThread::sCurrentThreadTLS object which would later influence what AbstractThread::GetCurrent() would return.
MessageLoopAbstractThreadWrapper no longer exists. So AutoEnter is no longer necessary and should be removed as it caused unnecessary logical burden.
Assignee | ||
Comment 1•5 years ago
|
||
prior bug 1364821, AbstractThread::GetCurrent() would always return AbstractThread::MainThread() when called from the main thread.
After this change, we had to run within an AutoEnter scope.
A hidden side effect of this change was that under most cases AbstractThread::MainThread::Dispatch() would no longer use the tail dispatcher to dispatch a task.
It can be safely assume that whenever you're on the main thread, the equivalent AbstractThread is usable.
In the next commit, we will be removing AutoEnter entirely.
Assignee | ||
Comment 2•5 years ago
|
||
AbstractThread::MainThread() requires TailDispatcher to work which itself relies on the nsCycleCollectors to have been initialised.
This early in the XPCOM initilization, it doesn't work.
A bug was hiding the fact that the tail dispatcher wasn't available on the main thread by default.
Updated•5 years ago
|
Updated•5 years ago
|
Assignee | ||
Comment 3•5 years ago
|
||
AutoEnter was an attempt around a race between AbstractThread and MessageLoopAbstractThreadWrap that would cause AbstractThread::GetCurrent() to return an incorrect value. MessageLoopAbstractThreadWrapper is no more and as such AutoEnter is no longer required.
Include reversal of commit 3218d3c2662a (bug 1529399)
Depends on D71148
Assignee | ||
Comment 4•5 years ago
|
||
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Assignee | ||
Comment 5•5 years ago
|
||
It lead AbstractThread assumption that there can only be one active per thread to be false.
Depends on D71148
Updated•5 years ago
|
Assignee | ||
Comment 6•5 years ago
|
||
It was required once upon a time to be able to use MozPromise on Workers.
Today a MozPromise work with nsISerialEventTarget and no longer rely on this. It can go.
Depends on D71279
Assignee | ||
Comment 7•5 years ago
|
||
Once upon a time, a MozPromise required an AbstractThread as target thread. So we had to wrap the current child manager thread into an AbstractThread.
This is no longer the case, MozPromise now work with nsISerialEventTarger, which a nsIThread is. The AbstractThread used didn't support tail dispatch so the replacement was straight forward.
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Assignee | ||
Comment 8•5 years ago
|
||
This mechanism is currently unused (see bug 1624819), we can re-assess the issue once it becomes needed.
Assignee | ||
Comment 9•5 years ago
|
||
Depends on D71491
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Comment 10•5 years ago
|
||
Comment 11•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/1e5316093afd
https://hg.mozilla.org/mozilla-central/rev/a5b19d93ab3f
https://hg.mozilla.org/mozilla-central/rev/9ecfeb1915cd
https://hg.mozilla.org/mozilla-central/rev/b94e2c408ecc
https://hg.mozilla.org/mozilla-central/rev/5c3d7c51ecc3
https://hg.mozilla.org/mozilla-central/rev/8d9486cd19e8
https://hg.mozilla.org/mozilla-central/rev/7d104d25415c
https://hg.mozilla.org/mozilla-central/rev/c2a43696053d
https://hg.mozilla.org/mozilla-central/rev/ce0291e3f743
Description
•