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

Stipe Tolj <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Organization tolj.org system architecture
Message-ID <[email protected]>
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.

Stipe

-------------------------------------------------------------------
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
-------------------------------------------------------------------
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.