From owner-freebsd-stable@FreeBSD.ORG Wed Nov 25 01:56:37 2009 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A78D11065694; Wed, 25 Nov 2009 01:56:37 +0000 (UTC) (envelope-from davidxu@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 920248FC1D; Wed, 25 Nov 2009 01:56:37 +0000 (UTC) Received: from apple.my.domain (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id nAP1uYOo064827; Wed, 25 Nov 2009 01:56:35 GMT (envelope-from davidxu@freebsd.org) Message-ID: <4B0C8ED2.7030101@freebsd.org> Date: Wed, 25 Nov 2009 09:56:34 +0800 From: David Xu User-Agent: Thunderbird 2.0.0.9 (X11/20080612) MIME-Version: 1.0 To: Daniel Eischen References: <86aayc7z4g.fsf@zhuzha.ua1> <8663907xyy.fsf@zhuzha.ua1> <20091124153422.GT2331@deviant.kiev.zoral.com.ua> <200911242141.nAOLfAQa050429@drugs.dv.isc.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Kostik Belousov , FreeBSD Stable , Mikolaj Golub Subject: Re: pthread.h: typo in #define pthread_cleanup_push/pthread_cleanup_pop X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2009 01:56:37 -0000 Daniel Eischen wrote: > Hmm, agreed. But note that Solaris 10 does it this way: > > #define pthread_cleanup_push(routine, args) { \ > _cleanup_t _cleanup_info; \ > __pthread_cleanup_push((_Voidfp)(routine), (void *)(args), \ > (caddr_t)_getfp(), &_cleanup_info); > > #define pthread_cleanup_pop(ex) \ > __pthread_cleanup_pop(ex, &_cleanup_info); \ > } > Hmm, I considered using this style, but if there is a C++ object within the lexical scope, its destructor will execute after pthread_cleanup_pop(), this may not be correct, so I used extra pair of '{}'.