/* static */
void
SharedThreadPool::SpinUntilEmpty()
{
  MOZ_ASSERT(NS_IsMainThread());
  SpinEventLoopUntil([]() -> bool {
      sMonitor->AssertNotCurrentThreadIn();
      return IsEmpty();
  });
}
Beispiel #2
0
void
CompositorThreadHolder::Shutdown()
{
  MOZ_ASSERT(NS_IsMainThread(), "Should be on the main Thread!");
  if (!sCompositorThreadHolder) {
    // We've already shutdown or never started.
    return;
  }

  ImageBridgeParent::Shutdown();
  gfx::ReleaseVRManagerParentSingleton();
  MediaSystemResourceService::Shutdown();
  CompositorManagerParent::Shutdown();

  sCompositorThreadHolder = nullptr;

  // No locking is needed around sFinishedCompositorShutDown because it is only
  // ever accessed on the main thread.
  SpinEventLoopUntil([&]() { return sFinishedCompositorShutDown; });

  CompositorBridgeParent::FinishShutdown();
}