PR_Lock(mLock); CategoryNode* category = get_category(aCategoryName); PR_Unlock(mLock);  if (!category) { return NS_NewEmptyEnumerator(_retval);
*_retval = 0;  nsresult status = NS_ERROR_NOT_AVAILABLE; CategoryNode* category = find_category(aCategoryName); if (category) { nsCOMPtr<nsIEnumerator> innerEnumerator; if ( NS_SUCCEEDED(status = NS_NewHashtableEnumerator(category, ExtractKeyString, 0, getter_AddRefs(innerEnumerator))) ) status = NS_NewAdapterEnumerator(_retval, innerEnumerator); }   if ( NS_FAILED(status) ) { NS_IF_RELEASE(*_retval); status = NS_NewEmptyEnumerator(_retval); }  return status;
nsCategoryManager::EnumerateCategory( const char *aCategoryName,                                      nsISimpleEnumerator **_retval ){  NS_ENSURE_ARG_POINTER(aCategoryName);  NS_ENSURE_ARG_POINTER(_retval);  PR_Lock(mLock);  CategoryNode* category = get_category(aCategoryName);  PR_Unlock(mLock);    if (!category) {    return NS_NewEmptyEnumerator(_retval);  }  return category->Enumerate(_retval);}