[PATCH] Cygwin 1.2.25+ support via gix in gwlib/conn.c (openssl thread callbacks)

Stipe Tolj st at tolj.org
Sat Jul 19 20:59:49 CEST 2008

Stipe Tolj schrieb:
> some more debug information for the pthread issues on Cygwin:
> as gwlib/conn.c uses our gwthread_self() as callback function for 
> openssl's CRYPTO_set_id_callback():
> /* Return the thread id of this thread. */
> long gwthread_self(void)
> {
>     struct threadinfo *threadinfo;
>     threadinfo = pthread_getspecific(tsd_key);
>     if (threadinfo)
>         return threadinfo->number;
>     else {
>         printf("XXX gwthread_self with empty threadinfo\n");
>         return -1;
>     }
> }

my suspect so far is pthread_getspecific() on the Cygwin platform. Seems they 
have issues with it. And keep in mind that the gwlib/thread.c uses 
gwthread_self() also in the mutex_foonbar() calls, hence we bang.

I can have a cywin specific gwlib/gwthread-pthread-cygwin.c that avoids the 
tsd_key usage and hence avoids pthread_[get|set]specific() void* data for 
threads and stores the corresponding threadinfo records to a global (and hence 
self-locked) table.


Kölner Landstrasse 419
40589 Düsseldorf, NRW, Germany

tolj.org system architecture      Kannel Software Foundation (KSF)
http://www.tolj.org/              http://www.kannel.org/

mailto:st_{at}_tolj.org           mailto:stolj_{at}_kannel.org

More information about the devel mailing list