tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit c04c964cc11d046e24be066ed97a4686621af148
parent 4d6bf34db5c6e983eae0fbb4dfc6ff980c7e814e
Author: Kui-Feng Lee <thinker.li@gmail.com>
Date:   Fri,  9 Jan 2026 17:14:30 +0000

Bug 2009073 - Crash instead of returning error when thread creation fails in nsThreadPool::PutEvent(). r=xpcom-reviewers,jstutte

Change nsThreadPool::PutEvent() to use MOZ_CRASH() instead of returning
NS_ERROR_UNEXPECTED when NS_NewNamedThread() fails to create a new thread.

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

Diffstat:
Mxpcom/threads/nsThreadPool.cpp | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xpcom/threads/nsThreadPool.cpp b/xpcom/threads/nsThreadPool.cpp @@ -209,7 +209,7 @@ nsresult nsThreadPool::PutEvent(already_AddRefed<nsIRunnable> aEvent, mThreadNaming.GetNextThreadName(mName), getter_AddRefs(thread), this, {.stackSize = mStackSize, .blockDispatch = true}); if (NS_WARN_IF(NS_FAILED(rv))) { - return NS_ERROR_UNEXPECTED; + MOZ_CRASH("nsThreadPool::PutEvent() - Failed to create a new thread"); } mThreads.AppendObject(thread);