In message <[EMAIL PROTECTED]> on Mon, 16 Dec 2002 17:18:18 
+0100, "Ralf S. Engelschall" <[EMAIL PROTECTED]> said:

rse> >   -      if (init_ciphers) load_ciphers();
rse> >   +      if (init_ciphers)
rse> >   +              {
rse> >   +              CRYPTO_w_lock(CRYPTO_LOCK_SSL);
rse> >   +              if (init_ciphers) load_ciphers();
rse> >   +              CRYPTO_w_unlock(CRYPTO_LOCK_SSL);
rse> >   +              }
rse> 
rse> Just curious: why the nested "if (init_ciphers) .."?

Same thing as in other places: a performance thing.  If the flag is
already set, avoid the overhead of locking.  If it wasn't set, lock
and check that it still isn't set to avoid the possible race
condition.

-- 
Richard Levitte   \ Spannv�gen 38, II \ [EMAIL PROTECTED]
Redakteur@Stacken  \ S-168 35  BROMMA  \ T: +46-8-26 52 47
                    \      SWEDEN       \ or +46-708-26 53 44
Procurator Odiosus Ex Infernis                -- [EMAIL PROTECTED]
Member of the OpenSSL development team: http://www.openssl.org/

Unsolicited commercial email is subject to an archival fee of $400.
See <http://www.stacken.kth.se/~levitte/mail/> for more info.
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to