pthread.h: typo in #define pthread_cleanup_push/pthread_cleanup_pop

David Xu davidxu at freebsd.org
Wed Nov 25 01:56:37 UTC 2009


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
'{}'.



More information about the freebsd-stable mailing list