rv = thread->Init(runnable, stackSize, priority, scope, state); if (NS_FAILED(rv)) { NS_RELEASE(thread); return rv; }
NS_NewThread(nsIThread* *result,              PRUint32 stackSize,             PRThreadState state,             PRThreadPriority priority,             PRThreadScope scope){    nsThread* thread = new nsThread();    if (thread == nsnull)        return NS_ERROR_OUT_OF_MEMORY;    NS_ADDREF(thread);    *result = thread;    return NS_OK;}