Closed Bug 1566955 Opened 5 years ago Closed 5 years ago

Get rid of main thread requirement in mscom::EnsureMTA

Categories

(Core :: IPC: MSCOM, task, P1)

Unspecified
Windows
task

Tracking

()

RESOLVED FIXED
mozilla70
Tracking Status
firefox70 --- fixed

People

(Reporter: bugzilla, Assigned: bugzilla)

References

Details

Attachments

(1 file)

Currently we assert if EnsureMTA is being instantiated off main thread, when the current thread is not already inside an MTA.

The reason for this was because we needed to ensure that sMTAData was only created once, and cleared on shutdown.

We can still do that, but we can also do it in a way that is more thread-friendly.

Until now we asserted that EnsureMTA was being called from the main thread
unless the current thread was already in the MTA.

This patch makes MTA thread initialization thread-safe by using a C++11
"magic static," thus allowing EnsureMTA to be safely invoked from any thread.

Pushed by aklotz@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/daf3f25dd398
Make EnsureMTA fully thread-safe; r=Jamie
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla70
Regressions: 1568361
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: