From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/411 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: cluts daily reports 8/12 - continuing pthread_eintr, still stuck with alloc Date: Sat, 13 Aug 2011 14:43:08 -0400 Message-ID: <20110813184308.GK132@brightrain.aerifal.cx> References: <4E4493E6.6050809@gmail.com> <20110812024151.GF132@brightrain.aerifal.cx> <4E45496A.3010505@gmail.com> <20110812153934.GI132@brightrain.aerifal.cx> <4E46C747.1080006@gmail.com> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1313261797 24460 80.91.229.12 (13 Aug 2011 18:56:37 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 13 Aug 2011 18:56:37 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-412-gllmg-musl=m.gmane.org@lists.openwall.com Sat Aug 13 20:56:34 2011 Return-path: Envelope-to: gllmg-musl@lo.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by lo.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1QsJNp-0000KU-Dk for gllmg-musl@lo.gmane.org; Sat, 13 Aug 2011 20:56:33 +0200 Original-Received: (qmail 13336 invoked by uid 550); 13 Aug 2011 18:56:32 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 12282 invoked from network); 13 Aug 2011 18:56:31 -0000 Content-Disposition: inline In-Reply-To: <4E46C747.1080006@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:411 Archived-At: On Sat, Aug 13, 2011 at 08:49:43PM +0200, Luka Marčetić wrote: > pthread_exit is allegedly called upon main thread function return, > and it is specified to pop and execute pushed functions. I expected pthread_exit is called implicitly upon the return from the start function of any thread *except* the main thread. pthread_exit does pop and execute cleanup handlers when it's called, but if it's called implcitly due to return from the start function, there cannot be any cleanup handlers left because execution has already left the scope of any cleanup handler that may have been installed. > this to happen. I was blaming the spec for not being more specific, > and saying that pthread_exit should be explicitly called. But in > reality, perhaps even an implicit call should work, in which case > the spec isn't to blame, but both implementations instead? Could you please explain what effect you're trying to achieve? Cleanup handlers are rather useless unless you're using pthread_cancel. Rich