/* InitSessionCacheLocks is called, protected by lockOnce, to create the * session cache locks. */ static PRStatus InitSessionCacheLocks(void) { SECStatus rv; cacheLock = PZ_NewLock(nssILockCache); if (cacheLock == NULL) { return PR_FAILURE; } rv = ssl_InitSymWrapKeysLock(); if (rv != SECSuccess) { PRErrorCode error = PORT_GetError(); PZ_DestroyLock(cacheLock); cacheLock = NULL; PORT_SetError(error); return PR_FAILURE; } rv = NSS_RegisterShutdown(FreeSessionCacheLocks, NULL); PORT_Assert(SECSuccess == rv); if (SECSuccess != rv) { return PR_FAILURE; } return PR_SUCCESS; }
static SECStatus InitSessionCacheLocks(void) { SECStatus rv1, rv2; PRErrorCode rc; rv1 = ssl_InitSymWrapKeysLock(); rv2 = ssl_InitClientSessionCacheLock(); if ( (SECSuccess == rv1) && (SECSuccess == rv2) ) { return SECSuccess; } rc = PORT_GetError(); FreeSessionCacheLocks(); PORT_SetError(rc); return SECFailure; }