Have you considered instead using standard features as specified in POSIX since around 1996? What's your plan for other POSIX systems, such as Solaris? If you don't want to cancel threads as cancellation is defined by POSIX, then why use cancellation instead of another mechanism that matches your needs?