status = PR_NewThreadPrivateIndex(&gToolkitTLSIndex, NULL);
status = PR_NewThreadPrivateIndex(&gToolkitTLSIndex, nsnull);
NS_METHOD NS_GetCurrentToolkit(nsIToolkit* *aResult){  nsIToolkit* toolkit = nsnull;  nsresult rv = NS_OK;  PRStatus status;  // Create the TLS (Thread Local Storage) index the first time through  if (gToolkitTLSIndex == 0)  {    status = PR_NewThreadPrivateIndex(&gToolkitTLSIndex, NULL);    if (PR_FAILURE == status)    {      rv = NS_ERROR_FAILURE;    }  }  if (NS_SUCCEEDED(rv))  {    toolkit = (nsIToolkit*)PR_GetThreadPrivate(gToolkitTLSIndex);    //    // Create a new toolkit for this thread...    //    if (!toolkit) {      toolkit = new nsToolkit();            if (!toolkit) {        rv = NS_ERROR_OUT_OF_MEMORY;      } else {        NS_ADDREF(toolkit);        toolkit->Init(PR_GetCurrentThread());        //        // The reference stored in the TLS is weak.  It is removed in the        // nsToolkit destructor...        //        PR_SetThreadPrivate(gToolkitTLSIndex, (void*)toolkit);      }    } else {      NS_ADDREF(toolkit);    }    *aResult = toolkit;  }  return rv;}