Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Nov 2009 09:56:34 +0800
From:      David Xu <davidxu@freebsd.org>
To:        Daniel Eischen <deischen@freebsd.org>
Cc:        Kostik Belousov <kostikbel@gmail.com>, FreeBSD Stable <freebsd-stable@freebsd.org>, Mikolaj Golub <to.my.trociny@gmail.com>
Subject:   Re: pthread.h: typo in	#define	pthread_cleanup_push/pthread_cleanup_pop
Message-ID:  <4B0C8ED2.7030101@freebsd.org>
In-Reply-To: <Pine.GSO.4.64.0911241718490.5810@sea.ntplx.net>
References:  <86aayc7z4g.fsf@zhuzha.ua1> <8663907xyy.fsf@zhuzha.ua1>	<20091124153422.GT2331@deviant.kiev.zoral.com.ua>	<200911242141.nAOLfAQa050429@drugs.dv.isc.org> <Pine.GSO.4.64.0911241718490.5810@sea.ntplx.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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
'{}'.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4B0C8ED2.7030101>