From owner-freebsd-threads@FreeBSD.ORG Fri May 30 23:27:00 2008 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from alona.my.domain (localhost [127.0.0.1]) by hub.freebsd.org (Postfix) with ESMTP id D321E106567D; Fri, 30 May 2008 23:26:59 +0000 (UTC) (envelope-from davidxu@freebsd.org) Message-ID: <48408D5E.2010609@freebsd.org> Date: Sat, 31 May 2008 07:27:26 +0800 From: David Xu User-Agent: Thunderbird 2.0.0.9 (X11/20080323) MIME-Version: 1.0 To: Daniel Eischen References: <483FA1C0.2010506@freebsd.org> <200805301748.29689.jhb@freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-threads@freebsd.org Subject: Re: pthread_cleanup_push as a macro X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2008 23:27:00 -0000 Daniel Eischen wrote: > On Fri, 30 May 2008, John Baldwin wrote: > >> On Friday 30 May 2008 02:42:08 am David Xu wrote: >>> I would like to make pthread_cleanup_push and pthread_cleanup_pop as a >>> pair of macros, the current implementation has to malloc() and free() a >>> pthread_cleanup memory block everytime, this is slow, the new one >>> simply uses stack space, note that other OSes have already done it in >>> this way. The patch keeps old functions and should not have binary >>> compatible problem. >>> >>> http://people.freebsd.org/~davidxu/patch/pthread_cleanup_push.patch >> >> Please do! > > I agree - Solaris does this too. I am unsure why you really need > a strong_reference - I would prefer something that doesn't require > it. > This becauses original _pthread_cleanup_push and _pthread_cleanup_pop are functions but not weak aliases, it is to keep compatibility.