pthread.h: typo in #define
pthread_cleanup_push/pthread_cleanup_pop
Mikolaj Golub
to.my.trociny at gmail.com
Tue Nov 24 15:47:47 UTC 2009
On Tue, 24 Nov 2009 17:34:22 +0200 Kostik Belousov wrote:
> pthread_cleanup_push/pop are supposed to be used from the common
> lexical scope. Citation from SUSv4:
>
> These functions may be implemented as macros. The application shall
> ensure that they appear as statements, and in pairs within the same
> lexical scope (that is, the pthread_cleanup_push() macro may be
> thought to expand to a token list whose first token is '{' with
> pthread_cleanup_pop() expanding to a token list whose last token is the
> corresponding '}' ).
>
> Your change is wrong.
>
> Basically, the code should do
> pthread_cleanup_push(some_func, arh);
> something ...
> pthread_cleanup_pop(1);
> (1 denotes that some_func should be called).
I see. Thank you. So it really looks like a bug in our application as
pthread_cleanup_pop(1) is missed. I will tell our developers :-)
--
Mikolaj Golub
More information about the freebsd-stable
mailing list