* Ralf S. Engelschall ([EMAIL PROTECTED]) wrote:
> >   - if (init_ciphers) load_ciphers();
> >   + if (init_ciphers)
> >   +         {
> >   +         CRYPTO_w_lock(CRYPTO_LOCK_SSL);
> >   +         if (init_ciphers) load_ciphers();
> >   +         CRYPTO_w_unlock(CRYPTO_LOCK_SSL);
> >   +         }
> 
> Just curious: why the nested "if (init_ciphers) .."?

Because once load_ciphers() is called by the first thread to win the
race (during which any competing threads will be waiting on the lock),
future passes through this code won't need to lock at all.

Cheers,
Geoff

-- 
Geoff Thorpe
[EMAIL PROTECTED]
http://www.openssl.org/

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to