diff options
author | wtc%netscape.com <devnull@localhost> | 2002-04-17 01:03:23 +0000 |
---|---|---|
committer | wtc%netscape.com <devnull@localhost> | 2002-04-17 01:03:23 +0000 |
commit | c8f6e9bea58634c1eca5e72b021c0f11fd8fe36b (patch) | |
tree | 9a6debf0e2b561db79734bd1c99e80241f1b1f4a /security/nss/lib | |
parent | 2959faa536970e56cd627023917a2cd92d2e56d9 (diff) | |
download | nss-hg-c8f6e9bea58634c1eca5e72b021c0f11fd8fe36b.tar.gz |
Bugzilla bug 126087: removed symKey->refLock because we are using atomic
routines on symKey->refCount now. Declare symKey->refCount as PRInt32 to
match the prototype of PR_AtomicIncrement/Decrement.
Modified files: pk11skey.c secmodti.h
Diffstat (limited to 'security/nss/lib')
-rw-r--r-- | security/nss/lib/pk11wrap/pk11skey.c | 11 | ||||
-rw-r--r-- | security/nss/lib/pk11wrap/secmodti.h | 3 |
2 files changed, 1 insertions, 13 deletions
diff --git a/security/nss/lib/pk11wrap/pk11skey.c b/security/nss/lib/pk11wrap/pk11skey.c index fd1cd3b14..f98a39d87 100644 --- a/security/nss/lib/pk11wrap/pk11skey.c +++ b/security/nss/lib/pk11wrap/pk11skey.c @@ -179,11 +179,6 @@ pk11_getKeyFromList(PK11SlotInfo *slot) { if (symKey == NULL) { return NULL; } - symKey->refLock = PZ_NewLock(nssILockRefLock); - if (symKey->refLock == NULL) { - PORT_Free(symKey); - return NULL; - } symKey->session = pk11_GetNewSession(slot,&symKey->sessionOwner); symKey->next = NULL; return symKey; @@ -198,7 +193,6 @@ PK11_CleanKeyList(PK11SlotInfo *slot) symKey = slot->freeSymKeysHead; slot->freeSymKeysHead = symKey->next; pk11_CloseSession(slot, symKey->session,symKey->sessionOwner); - PK11_USE_THREADS(PZ_DestroyLock(symKey->refLock);) PORT_Free(symKey); }; return; @@ -242,14 +236,10 @@ PK11_CreateSymKey(PK11SlotInfo *slot, CK_MECHANISM_TYPE type, void *wincx) void PK11_FreeSymKey(PK11SymKey *symKey) { - PRBool destroy = PR_FALSE; PK11SlotInfo *slot; PRBool freeit = PR_TRUE; if (PR_AtomicDecrement(&symKey->refCount) == 0) { - destroy= PR_TRUE; - } - if (destroy) { if ((symKey->owner) && symKey->objectID != CK_INVALID_HANDLE) { pk11_EnterKeyMonitor(symKey); (void) PK11_GETTAB(symKey->slot)-> @@ -273,7 +263,6 @@ PK11_FreeSymKey(PK11SymKey *symKey) if (freeit) { pk11_CloseSession(symKey->slot, symKey->session, symKey->sessionOwner); - PK11_USE_THREADS(PZ_DestroyLock(symKey->refLock);) PORT_Free(symKey); } PK11_FreeSlot(slot); diff --git a/security/nss/lib/pk11wrap/secmodti.h b/security/nss/lib/pk11wrap/secmodti.h index 9d3919903..a2e81acc6 100644 --- a/security/nss/lib/pk11wrap/secmodti.h +++ b/security/nss/lib/pk11wrap/secmodti.h @@ -145,8 +145,7 @@ struct PK11SymKeyStr { SECItem data; /* raw key data if available */ CK_SESSION_HANDLE session; PRBool sessionOwner; - int refCount; /* number of references to this key */ - PZLock *refLock; + PRInt32 refCount; /* number of references to this key */ int size; /* key size in bytes */ PK11Origin origin; /* where this key came from (see def in secmodt.h) */ |