Bug 1190496 - Add a comment warning about MSCOM modes. r=cpearce
authorBobby Holley <bobbyholley@gmail.com>
Mon, 03 Aug 2015 11:49:42 -0700
changeset 287865 2a7cc98d59ef360d1ace0c31ef9fb50345f55da4
parent 287864 4b540d54de839ba764b7bc815b39390d2b090dc2
child 287866 7edc83e08f2361c7539eaba67298ed7be4c4e505
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce
bugs1190496
milestone42.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1190496 - Add a comment warning about MSCOM modes. r=cpearce
dom/media/SharedThreadPool.h
--- a/dom/media/SharedThreadPool.h
+++ b/dom/media/SharedThreadPool.h
@@ -19,18 +19,25 @@
 namespace mozilla {
 
 // Wrapper that makes an nsIThreadPool a singleton, and provides a
 // consistent threadsafe interface to get instances. Callers simply get a
 // SharedThreadPool by the name of its nsIThreadPool. All get requests of
 // the same name get the same SharedThreadPool. Users must store a reference
 // to the pool, and when the last reference to a SharedThreadPool is dropped
 // the pool is shutdown and deleted. Users aren't required to manually
-// shutdown the pool, and can release references on any thread. On Windows
-// all threads in the pool have MSCOM initialized with COINIT_MULTITHREADED.
+// shutdown the pool, and can release references on any thread.
+//
+// On Windows all threads in the pool have MSCOM initialized with
+// COINIT_MULTITHREADED. Note that not all users of MSCOM use this mode see [1],
+// and mixing MSCOM objects between the two is terrible for performance, and can
+// cause some functions to fail. So be careful when using Win32 APIs on a
+// SharedThreadPool, and avoid sharing objects if at all possible.
+//
+// [1] http://mxr.mozilla.org/mozilla-central/search?string=coinitialize
 class SharedThreadPool : public nsIThreadPool
 {
 public:
 
   // Gets (possibly creating) the shared thread pool singleton instance with
   // thread pool named aName.
   // *Must* be called on the main thread.
   static already_AddRefed<SharedThreadPool> Get(const nsCString& aName,