Skip to content

Commit

Permalink
Fix deadlock bugscape 46733
Browse files Browse the repository at this point in the history
  • Loading branch information
relyea%netscape.com committed Jun 20, 2003
1 parent 9d25fdd commit 5e4479c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions security/nss/lib/dev/devslot.c
Expand Up @@ -48,7 +48,11 @@ static const char CVS_ID[] = "@(#) $RCSfile$ $Revision$ $Date$ $Name$";
#endif /* CKHELPER_H */

/* measured in seconds */
#ifdef DARWIN
#define NSSSLOT_TOKEN_DELAY_TIME 3
#else
#define NSSSLOT_TOKEN_DELAY_TIME 1
#endif

/* this should track global and per-transaction login information */

Expand Down Expand Up @@ -257,8 +261,7 @@ within_token_delay_period(NSSSlot *slot)
}
time = PR_IntervalNow();
lastTime = slot->lastTokenPing;
if ((lastTime) &&
(time > lastTime) && ((time - lastTime) < s_token_delay_time)) {
if ((lastTime) && ((time - lastTime) < s_token_delay_time)) {
return PR_TRUE;
}
slot->lastTokenPing = time;
Expand All @@ -285,6 +288,7 @@ nssSlot_IsTokenPresent
if (within_token_delay_period(slot)) {
return (PRBool)((slot->ckFlags & CKF_TOKEN_PRESENT) != 0);
}

/* First obtain the slot info */
#ifdef PURE_STAN_BUILD
epv = nssModule_GetCryptokiEPV(slot->module);
Expand Down

0 comments on commit 5e4479c

Please sign in to comment.