This is the mail archive of the mailing list for the pthreas-win32 project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Static libraries initialization

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
file format:

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
 | \__) |

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]