Bug 975255 - HTTP cache v2: optimize CacheIOThread::Target(), r=michal
authorHonza Bambas <honzab.moz@firemni.cz>
Thu, 27 Feb 2014 00:11:42 +0100
changeset 191185 75c53d96a9c94a3c4f8b36f6f5245bf8d06443a4
parent 191184 a0b80ff2d63813ee13d9f25932c508dc26693d6e
child 191186 b5d8474e3042d2c32e85b1fc0435cd593c2ca572
push id474
push userasasaki@mozilla.com
push dateMon, 02 Jun 2014 21:01:02 +0000
treeherdermozilla-release@967f4cf1b31c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmichal
bugs975255
milestone30.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 975255 - HTTP cache v2: optimize CacheIOThread::Target(), r=michal
netwerk/cache2/CacheIOThread.cpp
--- a/netwerk/cache2/CacheIOThread.cpp
+++ b/netwerk/cache2/CacheIOThread.cpp
@@ -108,17 +108,18 @@ nsresult CacheIOThread::Shutdown()
 
   return NS_OK;
 }
 
 already_AddRefed<nsIEventTarget> CacheIOThread::Target()
 {
   nsCOMPtr<nsIEventTarget> target;
 
-  if (mThread)
+  target = mXPCOMThread;
+  if (!target && mThread)
   {
     MonitorAutoLock lock(mMonitor);
     if (!mXPCOMThread)
       lock.Wait();
 
     target = mXPCOMThread;
   }