mShutdownRequired is already tested to avoid multiple shutdown runnables, so
callers need not test mThread, which is racy.
DecodePoolImpl, at least, can call both Shutdown() and AsyncShutdown()
on a single thread, and the later call can occur at the same time as the
thread is exiting its event loop and clearing mThread.
https://searchfox.org/mozilla-central/rev/23d4bffcad365e68d2d45776017056b76ca9a968/image/DecodePool.cpp#91
AsyncShutdown() and Shutdown() now return NS_OK when ShutdownInternal()
returns null because this would now usually happen when shutdown has already
been initiated.
Differential Revision: https://phabricator.services.mozilla.com/D56612
--HG--
extra : moz-landing-system : lando