Closed Bug 1626346 Opened 4 years ago Closed 2 years ago

Background thread pools should register the ThreadPoolCOMListener on Windows

Categories

(Core :: XPCOM, task)

Unspecified
Windows
task
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: bugzilla, Unassigned)

References

(Blocks 2 open bugs)

Details

Doing this makes it possible for us to properly call COM APIs on the background thread pool. It probably kinda sorta works right now under certain circumstances [1], but we should make this explicit.

See https://searchfox.org/mozilla-central/rev/fa2df28a49883612bd7af4dacd80cdfedcccd2f6/dom/media/ThreadPoolCOMListener.cpp

We register that for SharedThreadPool, but we should be doing this for the background thread pool as well.

I also think that we should move ThreadPoolCOMListener to ipc/mscom, since it's useful far above and beyond just media code.

[1] Once the first CoInitializeEx(nullptr, COINIT_MULTITHREADED) call happens in a process, all threads that are not already CoInitializeEx'd receive an implicit COM initialization. But if that call hasn't happened yet, then no threads receive that implicit initialization.

After bug 1707954, all background threads should be part of the implicit MTA without any additional work, since ProcessRuntime is initialised before anything else and it eagerly brings up the MTA. Also, ThreadPoolCOMListener is gone as of bug 1546154 part 6 anyway.

Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.