Bug 399304: In cert_InitLocks, we can use PZ_NewLock to create the locks
authorwtc%google.com
Tue, 13 Nov 2007 23:10:45 +0000
changeset 8221 425c5b76ff22dc1c9c1b4c08d94e37c17283d152
parent 8220 94963b1b5667a25117a128e37120275a27090bf8
child 8222 26b81a6794b618448a20c48cad990bca1e82a3f8
push idunknown
push userunknown
push dateunknown
bugs399304
Bug 399304: In cert_InitLocks, we can use PZ_NewLock to create the locks because cert_InitLocks is called by nss_Init. r=julien.pierre
security/nss/lib/certdb/certdb.c
--- a/security/nss/lib/certdb/certdb.c
+++ b/security/nss/lib/certdb/certdb.c
@@ -2733,25 +2733,25 @@ CERT_LockCertTrust(CERTCertificate *cert
     PZ_Lock(certTrustLock);
     return;
 }
 
 SECStatus
 cert_InitLocks(void)
 {
     if ( certRefCountLock == NULL ) {
-        nss_InitLock(&certRefCountLock, nssILockRefLock);
+        certRefCountLock = PZ_NewLock(nssILockRefLock);
         PORT_Assert(certRefCountLock != NULL);
         if (!certRefCountLock) {
             return SECFailure;
         }
     }
 
     if ( certTrustLock == NULL ) {
-        nss_InitLock(&certTrustLock, nssILockCertDB);
+        certTrustLock = PZ_NewLock(nssILockCertDB);
         PORT_Assert(certTrustLock != NULL);
         if (!certTrustLock) {
             PZ_DestroyLock(certRefCountLock);
             return SECFailure;
         }
     }    
 
     return SECSuccess;