Bug 1323100 - Use nsThreadPoolNaming::GetNextThreadName and NS_NewNamedThread for the mozStorage thread. r?froydnj
MozReview-Commit-ID: 145CjwiQawB
--- a/storage/mozStorageConnection.cpp
+++ b/storage/mozStorageConnection.cpp
@@ -584,24 +584,23 @@ Connection::getAsyncExecutionTarget()
MutexAutoLock lockedScope(sharedAsyncExecutionMutex);
// If we are shutting down the asynchronous thread, don't hand out any more
// references to the thread.
if (mAsyncExecutionThreadShuttingDown)
return nullptr;
if (!mAsyncExecutionThread) {
- nsresult rv = ::NS_NewThread(getter_AddRefs(mAsyncExecutionThread));
+ static nsThreadPoolNaming naming;
+ nsresult rv = NS_NewNamedThread(naming.GetNextThreadName("mozStorage"),
+ getter_AddRefs(mAsyncExecutionThread));
if (NS_FAILED(rv)) {
NS_WARNING("Failed to create async thread.");
return nullptr;
}
- static nsThreadPoolNaming naming;
- naming.SetThreadPoolName(NS_LITERAL_CSTRING("mozStorage"),
- mAsyncExecutionThread);
}
#ifdef DEBUG
mAsyncExecutionThreadIsAlive = true;
#endif
return mAsyncExecutionThread;
}