Bug 1603153 throw an exception from nsThread::GetPRThread() when there is no PRThread r=froydnj

as is done in LazyIdleThread::GetPRThread().

Differential Revision: https://phabricator.services.mozilla.com/D56826

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Karl Tomlinson 2019-12-12 21:53:58 +00:00
parent b7a5c8548a
commit da14646552

View File

@ -776,8 +776,9 @@ nsThread::IsOnCurrentThreadInfallible() {
NS_IMETHODIMP
nsThread::GetPRThread(PRThread** aResult) {
*aResult = mThread;
return NS_OK;
PRThread* thread = mThread; // atomic load
*aResult = thread;
return thread ? NS_OK : NS_ERROR_NOT_AVAILABLE;
}
NS_IMETHODIMP