I have found an error preventing pthread_cleanup_pop() and _POSIX_Thread_cancel_run() from running correctly. In both functions I have changed line: handler = (POSIX_Cancel_Handler_control *) _Chain_Tail( handler_stack ); to: handler = (POSIX_Cancel_Handler_control *) _Chain_Tail( handler_stack )->previous; and now everything seams to work OK. Vlada