>     /*** if (tid == 0)  this check was a bad idea, for further
>                         discussion of weak memory models and
>                         aggressive optimization techniques you are
>                         welcome to comp.programming.threads ***/

Been there, done that, and you're probably right the test should be
removed.

>     /*** anyway, pthread_once is not too good either - something
>         like a C++ constructor on a global static variable would be
>         much better ***/
>     pthread_once(&tid_once, init_openssl_tid);

That's not portable -- go look at the netscape/mozilla guidelines. 
Particularly if you'ure putting openssl in a shared library.  And
requiring C++ for threads to work seems like a very bad thing.

>     /* this is not 100% kosher, but still ... */
>     return (unsigned long) pthread_getspecific(tid_key);

C'mon.  You can't complain about pthread_t/ulong and not feel bad trying
to do void*/ulong.  At the cost of one ulong-sized indirect memory
fetch, the code I wrote is completely correct and portable.

> This all is sort of anal retentive, but hey - that's what the craft is
> all about :-)

I thought it was a black art. :)
        /r$

-- 
Zolera Systems, Securing web services (XML, SOAP, Signatures,
Encryption)
http://www.zolera.com
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to