mingw-cross-env-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Mingw-cross-env-list] Solving the Pthreads issue


From: Martin Lambers
Subject: Re: [Mingw-cross-env-list] Solving the Pthreads issue
Date: Tue, 11 May 2010 06:21:13 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

On Mon, 10. May 2010, 12:17:52 +0200, Volker Grabsch wrote:
> Martin Lambers <address@hidden> schrieb:
> > I did not have a look at it, but maybe it would be possible to 
> >       
> >       3) Patch pthreads-win32 so that the pthread_win32_thread_*
> >          functions are not needed anymore.
> > 
> 
> Your proposal looks very reasonable to me. Would you take
> to time to post exactly that proposal to Ross Johnson, the
> Pthreads-win32 maintainer?

I wrote to both Ross Johnson and the mailing list, and already got a
response from the mailing list. This situation has apparantly already be
solved, and in a better way than what I suggested.

Pthreads-win32 uses DLL hooks to automatically execute the attach/detach
functions. When using static libraries, DLL hooks are not available, so
the attach/detach functions have to be called manually.

But there is a feature of the PE executable file format used by Windows
to define hooks also in the case of static linking. Ramiro Polla sent a
patch that uses this approach. See
<http://sourceware.org/ml/pthreads-win32/2010/msg00006.html>.

If we're lucky, this already solves the problem. Can someone test this?

One problem might be that libraries which already call attach/detach
might run into problems, so we might need to be careful about the 
PTW32_STATIC_LIB flag being defined in the header files.

Martin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]