зеркало из https://github.com/mozilla/pjs.git
Bugzilla bug 214695: fixed incorrect use of PR_AtomicDecrement on reference
counts. The reference count should not be read "naked". Instead, we should simply use the return value of PR_AtomicDecrement for the result of the decrement. Modified Files: dev/devmod.c dev/devslot.c dev/devtoken.c pki/certificate.c pki/pkibase.c
This commit is contained in:
Родитель
42d179412d
Коммит
13f5b9e4ff
|
@ -32,7 +32,7 @@
|
|||
*/
|
||||
|
||||
#ifdef DEBUG
|
||||
static const char CVS_ID[] = "@(#) $RCSfile: devmod.c,v $ $Revision: 1.4 $ $Date: 2003-07-01 00:32:20 $ $Name: $";
|
||||
static const char CVS_ID[] = "@(#) $RCSfile: devmod.c,v $ $Revision: 1.5 $ $Date: 2003-08-01 02:02:43 $ $Name: $";
|
||||
#endif /* DEBUG */
|
||||
|
||||
#ifndef NSSCKEPV_H
|
||||
|
@ -714,8 +714,7 @@ nssModule_Destroy (
|
|||
)
|
||||
{
|
||||
PRUint32 i, numSlots;
|
||||
PR_AtomicDecrement(&mod->base.refCount);
|
||||
if (mod->base.refCount == 0) {
|
||||
if (PR_AtomicDecrement(&mod->base.refCount) == 0) {
|
||||
if (mod->numSlots == 0) {
|
||||
(void)nssModule_Unload(mod);
|
||||
return nssArena_Destroy(mod->base.arena);
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
*/
|
||||
|
||||
#ifdef DEBUG
|
||||
static const char CVS_ID[] = "@(#) $RCSfile: devslot.c,v $ $Revision: 1.17 $ $Date: 2003-07-11 21:52:04 $ $Name: $";
|
||||
static const char CVS_ID[] = "@(#) $RCSfile: devslot.c,v $ $Revision: 1.18 $ $Date: 2003-08-01 02:02:43 $ $Name: $";
|
||||
#endif /* DEBUG */
|
||||
|
||||
#ifndef NSSCKEPV_H
|
||||
|
@ -178,8 +178,7 @@ nssSlot_Destroy (
|
|||
)
|
||||
{
|
||||
if (slot) {
|
||||
PR_AtomicDecrement(&slot->base.refCount);
|
||||
if (slot->base.refCount == 0) {
|
||||
if (PR_AtomicDecrement(&slot->base.refCount) == 0) {
|
||||
PZ_DestroyLock(slot->base.lock);
|
||||
#ifdef PURE_STAN_BUILD
|
||||
nssToken_Destroy(slot->token);
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
*/
|
||||
|
||||
#ifdef DEBUG
|
||||
static const char CVS_ID[] = "@(#) $RCSfile: devtoken.c,v $ $Revision: 1.34 $ $Date: 2003-07-01 00:32:20 $ $Name: $";
|
||||
static const char CVS_ID[] = "@(#) $RCSfile: devtoken.c,v $ $Revision: 1.35 $ $Date: 2003-08-01 02:02:43 $ $Name: $";
|
||||
#endif /* DEBUG */
|
||||
|
||||
#ifndef NSSCKEPV_H
|
||||
|
@ -152,8 +152,7 @@ nssToken_Destroy (
|
|||
)
|
||||
{
|
||||
if (tok) {
|
||||
PR_AtomicDecrement(&tok->base.refCount);
|
||||
if (tok->base.refCount == 0) {
|
||||
if (PR_AtomicDecrement(&tok->base.refCount) == 0) {
|
||||
PZ_DestroyLock(tok->base.lock);
|
||||
nssTokenObjectCache_Destroy(tok->cache);
|
||||
return nssArena_Destroy(tok->base.arena);
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
*/
|
||||
|
||||
#ifdef DEBUG
|
||||
static const char CVS_ID[] = "@(#) $RCSfile: certificate.c,v $ $Revision: 1.46 $ $Date: 2003-01-30 05:12:10 $ $Name: $";
|
||||
static const char CVS_ID[] = "@(#) $RCSfile: certificate.c,v $ $Revision: 1.47 $ $Date: 2003-08-01 02:02:46 $ $Name: $";
|
||||
#endif /* DEBUG */
|
||||
|
||||
#ifndef NSSPKI_H
|
||||
|
@ -131,8 +131,7 @@ nssCertificate_Destroy (
|
|||
} else {
|
||||
nssTrustDomain_LockCertCache(td);
|
||||
}
|
||||
PR_AtomicDecrement(&c->object.refCount);
|
||||
if (c->object.refCount == 0) {
|
||||
if (PR_AtomicDecrement(&c->object.refCount) == 0) {
|
||||
/* --- remove cert and UNLOCK storage --- */
|
||||
if (cc) {
|
||||
nssCertificateStore_RemoveCertLOCKED(cc->certStore, c);
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
*/
|
||||
|
||||
#ifdef DEBUG
|
||||
static const char CVS_ID[] = "@(#) $RCSfile: pkibase.c,v $ $Revision: 1.20 $ $Date: 2003-05-02 03:01:13 $ $Name: $";
|
||||
static const char CVS_ID[] = "@(#) $RCSfile: pkibase.c,v $ $Revision: 1.21 $ $Date: 2003-08-01 02:02:47 $ $Name: $";
|
||||
#endif /* DEBUG */
|
||||
|
||||
#ifndef DEV_H
|
||||
|
@ -106,8 +106,7 @@ nssPKIObject_Destroy (
|
|||
{
|
||||
PRUint32 i;
|
||||
PR_ASSERT(object->refCount > 0);
|
||||
PR_AtomicDecrement(&object->refCount);
|
||||
if (object->refCount == 0) {
|
||||
if (PR_AtomicDecrement(&object->refCount) == 0) {
|
||||
for (i=0; i<object->numInstances; i++) {
|
||||
nssCryptokiObject_Destroy(object->instances[i]);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче