From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27397 invoked by alias); 19 May 2008 11:29:52 -0000 Received: (qmail 27389 invoked by uid 22791); 19 May 2008 11:29:52 -0000 X-Spam-Check-By: sourceware.org Received: from mx11.lb01.inode.at (HELO mx.inode.at) (62.99.145.13) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 19 May 2008 11:29:24 +0000 Received: from [80.109.63.211] (port=3926 helo=www.blackspace.at) by smartmx-11.inode.at with esmtp (Exim 4.50) id 1Jy3YO-0002NX-BU; Mon, 19 May 2008 13:29:20 +0200 Received: from [192.168.61.212] (abacus.loc [192.168.61.212]) by www.blackspace.at (Postfix) with ESMTP id 446F36B410E; Mon, 19 May 2008 14:02:56 +0200 (CEST) Message-ID: <48316487.7050403@chello.at> Date: Mon, 19 May 2008 11:29:00 -0000 From: Roland Schwarz User-Agent: Mozilla-Thunderbird 2.0.0.14 (X11/20080509) MIME-Version: 1.0 To: Pthreads-Win32 list Cc: Ross Johnson , Ramiro Polla Subject: Re: Static libraries initialization References: <481082AE.3030904@lisha.ufsc.br> <4810ABB9.10106@homemail.com.au> <4810D5C3.2070306@lisha.ufsc.br> <4811657E.40608@homemail.com.au> In-Reply-To: <4811657E.40608@homemail.com.au> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact pthreads-win32-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: pthreads-win32-owner@sourceware.org X-SW-Source: 2008/txt/msg00022.txt.bz2 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 Framboise. Regards, -- _________________________________________ _ _ | Roland Schwarz |_)(_ | aka. speedsnail | \__) | mailto:roland.schwarz@chello.at ________| http://www.blackspace.at