pthread_cleanup_push as a macro

David Xu davidxu at freebsd.org
Fri May 30 06:40:36 UTC 2008


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.

http://people.freebsd.org/~davidxu/patch/pthread_cleanup_push.patch

David Xu


More information about the freebsd-threads mailing list