Bug 942022 - Return safely when thread creation fails, in ReverbConvolver. r=karlt
authorPaul Adenot <paul@paul.cx>
Fri, 10 Jan 2014 16:01:18 +0100
changeset 163174 6a3a28e9c83dd1cb99fa1fc2196512aa1bafb3eb
parent 163173 a68d50181ebbec95e8cee964b5b29670ad24cd76
child 163175 3808bcb36005c3d58ac3ff0d26a4804d16552960
push id25984
push userryanvm@gmail.com
push dateMon, 13 Jan 2014 22:44:31 +0000
treeherdermozilla-central@425579efbac3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskarlt
bugs942022
milestone29.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 942022 - Return safely when thread creation fails, in ReverbConvolver. r=karlt
content/media/webaudio/blink/ReverbConvolver.cpp
--- a/content/media/webaudio/blink/ReverbConvolver.cpp
+++ b/content/media/webaudio/blink/ReverbConvolver.cpp
@@ -120,17 +120,20 @@ ReverbConvolver::ReverbConvolver(const f
             fftSize = m_maxRealtimeFFTSize;
         if (fftSize > m_maxFFTSize)
             fftSize = m_maxFFTSize;
     }
 
     // Start up background thread
     // FIXME: would be better to up the thread priority here.  It doesn't need to be real-time, but higher than the default...
     if (this->useBackgroundThreads() && m_backgroundStages.Length() > 0) {
-        m_backgroundThread.Start();
+        if (!m_backgroundThread.Start()) {
+          NS_WARNING("Cannot start convolver thread.");
+          return;
+        }
         CancelableTask* task = NewRunnableMethod(this, &ReverbConvolver::backgroundThreadEntry);
         m_backgroundThread.message_loop()->PostTask(FROM_HERE, task);
     }
 }
 
 ReverbConvolver::~ReverbConvolver()
 {
     // Wait for background thread to stop