Bug 602659 - move some mutex locking - r=roc
authorBenoit Jacob <bjacob@mozilla.com>
Tue, 12 Oct 2010 17:01:59 -0400
changeset 55379 08c58ca3f156ff1d16815f5e6865d0b3b7f00d83
parent 55378 69bcdcc0ef25251c1f614d150d70b3587af11183
child 55380 d3f448b20f2050c99c84da9dee8c6fe425da9486
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs602659
milestone2.0b8pre
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 602659 - move some mutex locking - r=roc
gfx/layers/opengl/ImageLayerOGL.cpp
--- a/gfx/layers/opengl/ImageLayerOGL.cpp
+++ b/gfx/layers/opengl/ImageLayerOGL.cpp
@@ -152,21 +152,21 @@ RecycleBin::GetBuffer(PRUint32 aSize)
   mRecycledBuffers.RemoveElementAt(last);
   return result;
 }
 
 void
 RecycleBin::RecycleTexture(GLTexture *aTexture, TextureType aType,
                            const gfxIntSize& aSize)
 {
+  MutexAutoLock lock(mLock);
+
   if (!aTexture->IsAllocated())
     return;
 
-  MutexAutoLock lock(mLock);
-
   if (!mRecycledTextures[aType].IsEmpty() && aSize != mRecycledTextureSizes[aType]) {
     mRecycledTextures[aType].Clear();
   }
   mRecycledTextureSizes[aType] = aSize;
   mRecycledTextures[aType].AppendElement()->TakeFrom(aTexture);
 }
 
 void