PLEvent *event; while (!mLoaded) { rv = currentThreadQ->WaitForEvent(&event); NS_ASSERTION(NS_SUCCEEDED(rv), "\n-->nsStringBundle::Init: currentThreadQ->WaitForEvent failed...\n"); if (NS_FAILED(rv)) return rv;
PLEvent *event; while (!mLoaded) { rv = currentThreadQ->WaitForEvent(&event); NS_ASSERTION(NS_SUCCEEDED(rv), "\n-->nsStringBundle::Init: currentThreadQ->WaitForEvent failed...\n"); if (NS_FAILED(rv)) break;
nsStringBundle::LoadProperties(){  // this is different than mLoaded, because we only want to attempt  // to load once  // we only want to load once, but if we've tried once and failed,  // continue to throw an error!  if (mAttemptedLoad) {    if (mLoaded)      return NS_OK;    else      return NS_ERROR_UNEXPECTED;  }    mAttemptedLoad = PR_TRUE;  //  // use eventloop instead  //  // create an event queue for this thread.  nsresult rv;  nsCOMPtr<nsIEventQueueService> service = do_GetService(NS_EVENTQUEUESERVICE_CONTRACTID, &rv);  if (NS_FAILED(rv)) return rv;    nsCOMPtr<nsIEventQueue> currentThreadQ;  rv = service->PushThreadEventQueue(getter_AddRefs(currentThreadQ));  NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);  nsCOMPtr<nsIURI> uri;  rv = NS_NewURI(getter_AddRefs(uri), mPropertiesURL.get());  if (NS_FAILED(rv)) return rv;  //   create and loader, then wait  nsCOMPtr<nsIStreamLoader> loader;  rv = NS_NewStreamLoader(getter_AddRefs(loader),                           uri,                           this /*the load observer*/);  NS_ASSERTION(NS_SUCCEEDED(rv), "\n-->nsStringBundle::Init: NS_NewStreamLoader failed...\n");  // process events until we're finished.  PLEvent *event;  while (!mLoaded) {    rv = currentThreadQ->WaitForEvent(&event);    NS_ASSERTION(NS_SUCCEEDED(rv), "\n-->nsStringBundle::Init: currentThreadQ->WaitForEvent failed...\n");    if (NS_FAILED(rv)) return rv;    rv = currentThreadQ->HandleEvent(event);    NS_ASSERTION(NS_SUCCEEDED(rv), "\n-->nsStringBundle::Init: currentThreadQ->HandleEvent failed...\n");    if (NS_FAILED(rv)) return rv;  }    rv = service->PopThreadEventQueue(currentThreadQ);  return rv;}