On Tue, 28 Aug 2001 12:13:40 -0400, you wrote:

>>     /*** 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.

Too bad there's no standard on what dlopen() should do with
"constructors" sections. But we can always ./configure anything we want,
can't we? Oh well...

>>     /* 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.

Believe me, I do feel bad about it :-) At least, most compilers won't
choke on it even if pthread_t is not scalar. Well, scrap it anyway.

>  At the cost of one ulong-sized indirect memory
>fetch, the code I wrote is completely correct and portable.

Absolutely.

>       /r$

Cheers!

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

Reply via email to