Bug 1212288 - Make ImageContainer::AllocateProducerID callable on all threads; r=roc
authorSebastian Hengst <archaeopteryx@coole-files.de>
Sun, 11 Oct 2015 18:13:10 +0200
changeset 267157 1d0b33ab526a55d39d92cb3cac1dec4ae49b1c42
parent 267156 eab6f9c125ccacff4482dd7a9bea8c0b08e98fa5
child 267158 9c65a4a58b552c3c19162b74c1e5bbfdb55548ed
push id66402
push userarchaeopteryx@coole-files.de
push dateSun, 11 Oct 2015 16:15:00 +0000
treeherdermozilla-inbound@ee4cb52e6b15 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs1212288
milestone44.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 1212288 - Make ImageContainer::AllocateProducerID callable on all threads; r=roc
gfx/layers/ImageContainer.cpp
--- a/gfx/layers/ImageContainer.cpp
+++ b/gfx/layers/ImageContainer.cpp
@@ -668,19 +668,18 @@ ImageContainer::NotifyComposite(const Im
   if (child) {
     MutexAutoLock lock(child->mLock);
     if (child->mImageContainer) {
       child->mImageContainer->NotifyCompositeInternal(aNotification);
     }
   }
 }
 
-static ImageContainer::ProducerID sProducerID = 0;
-
 ImageContainer::ProducerID
 ImageContainer::AllocateProducerID()
 {
-  NS_ASSERTION(NS_IsMainThread(), "Should be on main thread.");
+  // Callable on all threads.
+  static Atomic<ImageContainer::ProducerID> sProducerID(0u);
   return ++sProducerID;
 }
 
 } // namespace layers
 } // namespace mozilla