b=903270 set thread name for initial event of NS_NewNamedThread() r=dougt

--HG--
extra : transplant_source : %E7%24%5Be%ED.%F3HH%9A%9E%02r%EB%29%CD%EDf%09%F1
This commit is contained in:
Karl Tomlinson 2013-08-27 12:36:45 +12:00
parent 755583ce80
commit 0a31758810

View File

@ -71,9 +71,15 @@ NS_NewNamedThread(const char (&name)[LEN],
nsIRunnable *initialEvent = nullptr,
uint32_t stackSize = nsIThreadManager::DEFAULT_STACK_SIZE)
{
nsresult rv = NS_NewThread(result, initialEvent, stackSize);
NS_SetThreadName<LEN>(*result, name);
return rv;
nsresult rv = NS_NewThread(result, nullptr, stackSize);
NS_ENSURE_SUCCESS(rv, rv);
NS_SetThreadName<LEN>(*result, name);
if (initialEvent) {
rv = (*result)->Dispatch(initialEvent, NS_DISPATCH_NORMAL);
NS_WARN_IF_FALSE(NS_SUCCEEDED(rv), "Initial event dispatch failed");
}
return rv;
}
/**