if (!once->initialized) { if (PR_AtomicSet(&once->inProgress, 1) == 0) { once->status = (*func)(); PR_Lock(mod_init.ml); once->initialized = 1; PR_NotifyAllCondVar(mod_init.cv); PR_Unlock(mod_init.ml); } else { PR_Lock(mod_init.ml); while (!once->initialized) { PR_WaitCondVar(mod_init.cv, PR_INTERVAL_NO_TIMEOUT);
while (isdigit(*ptr)) { vmajor = 10 * vmajor + *ptr - '0'; ptr++; } if (*ptr == '.') { ptr++; while (isdigit(*ptr)) { vminor = 10 * vminor + *ptr - '0'; ptr++; } if (*ptr == '.') { ptr++; while (isdigit(*ptr)) { vpatch = 10 * vpatch + *ptr - '0'; ptr++;
PR_IMPLEMENT(PRStatus) PR_CallOnce(    PRCallOnceType *once,    PRCallOnceFN    func){    if (!_pr_initialized) _PR_ImplicitInitialization();    if (!once->initialized) {	if (PR_AtomicSet(&once->inProgress, 1) == 0) {	    once->status = (*func)();	    PR_Lock(mod_init.ml);	    once->initialized = 1;	    PR_NotifyAllCondVar(mod_init.cv);	    PR_Unlock(mod_init.ml);	} else {	    PR_Lock(mod_init.ml);	    while (!once->initialized) {		PR_WaitCondVar(mod_init.cv, PR_INTERVAL_NO_TIMEOUT);            }	    PR_Unlock(mod_init.ml);	}    }    return once->status;}