pthread_cleanup_push as a macro

David Xu davidxu at
Fri May 30 23:27:00 UTC 2008

Daniel Eischen wrote:
> On Fri, 30 May 2008, John Baldwin wrote:
>> On Friday 30 May 2008 02:42:08 am David Xu 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.
>> Please do!
> I agree - Solaris does this too.  I am unsure why you really need
> a strong_reference - I would prefer something that doesn't require
> it.

This becauses original _pthread_cleanup_push and _pthread_cleanup_pop are
functions but not weak aliases, it is to keep compatibility.

More information about the freebsd-threads mailing list