Bug 1437991 - Reduce scope of GetMainThread warning. r=froydnj

--HG--
extra : rebase_source : ec4e505fdefef42572e05a98348bef75473c8df2
This commit is contained in:
Eric Rahm 2019-01-04 15:41:52 -08:00
Родитель 221438b032
Коммит 68491ea9df
1 изменённых файлов: 6 добавлений и 1 удалений

Просмотреть файл

@ -454,7 +454,12 @@ nsThreadManager::NewNamedThread(const nsACString& aName, uint32_t aStackSize,
NS_IMETHODIMP
nsThreadManager::GetMainThread(nsIThread** aResult) {
// Keep this functioning during Shutdown
if (NS_WARN_IF(!mMainThread)) {
if (!mMainThread) {
if (!NS_IsMainThread()) {
NS_WARNING(
"Called GetMainThread but there isn't a main thread and "
"we're not the main thread.");
}
return NS_ERROR_NOT_INITIALIZED;
}
NS_ADDREF(*aResult = mMainThread);