In article <[EMAIL PROTECTED]> you wrote:
> 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.

Ah, now I see it. Thanks for clarifying this point.

                                       Ralf S. Engelschall
                                       [EMAIL PROTECTED]
                                       www.engelschall.com
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to