On Tue, Apr 19, 2011 at 10:58 PM, David Xu <davidxu at freebsd.org> wrote: > > But I don't touch curthread unless it is blocked by another thread. > You do a THR_CLEANUP_PUSH(curthread, once_cancel_handler, once_control); before calling *init_routine. THR_CLEANUP_PUSH touches curthread->cleanup;