Bug 1191063 - Followup comments. r=me DONTBUILD
authorBobby Holley <bobbyholley@gmail.com>
Tue, 04 Aug 2015 16:18:17 -0700
changeset 287910 5c158420a7faecf31952003a2ae28790f423fc05
parent 287909 a0e2077727c9824353022a60f4f8c230a686f935
child 287911 f951ca5e6d7cafbe2fdbcdaea68d51ec542e2fa3
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)
reviewersme
bugs1191063
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 1191063 - Followup comments. r=me DONTBUILD
xpcom/threads/SharedThreadPool.h
--- a/xpcom/threads/SharedThreadPool.h
+++ b/xpcom/threads/SharedThreadPool.h
@@ -19,32 +19,33 @@
 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.
+// shutdown the pool, and can release references on any thread. This can make
+// it significantly easier to use thread pools, because the caller doesn't need
+// to worry about joining and tearing it down.
 //
 // 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,
                                             uint32_t aThreadLimit = 4);
 
   // We implement custom threadsafe AddRef/Release pair, that destroys the
   // the shared pool singleton when the refcount drops to 0. The addref/release
   // are implemented using locking, so it's not recommended that you use them
   // in a tight loop.
   NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr) override;