pthread_cleanup_push as a macro

Alfred Perlstein alfred at
Fri May 30 18:41:41 UTC 2008

* David Xu <davidxu at> [080529 23:40] 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.

Heh, when I had to use QNX on a project this totally confused
me, but if others are doing it then go for it.

Does Solaris do it?


More information about the freebsd-threads mailing list