This is the mail archive of the
mailing list for the pthreas-win32 project.
Re: Static libraries initialization
- From: Roland Schwarz <roland dot schwarz at chello dot at>
- To: Pthreads-Win32 list <pthreads-win32 at sourceware dot org>
- Cc: Ross Johnson <Ross dot Johnson at homemail dot com dot au>, Ramiro Polla <ramiro at lisha dot ufsc dot br>
- Date: Mon, 19 May 2008 13:29:11 +0200
- Subject: Re: Static libraries initialization
- References: <481082AE.firstname.lastname@example.org> <4810ABB9.email@example.com> <4810D5C3.firstname.lastname@example.org> <4811657E.email@example.com>
Ross Johnson wrote:
> Now there is only the thread detach cleanup to deal with. I haven't
> found an equivalent to atexit() for win32 native threads. Is there one,
> or is there another way to make this automatic? The problem is as follows:-
Sorry for dropping in. I did not follow this list for a while, but the
above question triggered me.
While I was solving the cleanup problem for the boost TLS implementation
for static linking I came over a not so well known feature of the PE
The operating system calls into a hook on every detaching thread similar
to DllMain, but also for statically linked libs.
Withou going into detail: This is compiler dependent and has been made
working for MSVC and gcc compilers. Borland unfortunately cannot
be made to work. :-(
You might look for the details in the boost threading lib, or contact
me if you need more details.
Ah, yes not to forget to mention: credits for this idea go to Aaron La
_ _ | Roland Schwarz
|_)(_ | aka. speedsnail
| \__) | mailto:firstname.lastname@example.org