Registers a cleanup handler to be called after the thread's cleanup() is called. The thread takes ownership of the handler pointer. The inThread parameter when true means that the handler is called in the context of the thread just before termination - note that if it's a self-deleting thread, that means just before deletion. When false, the handler is called when the thread object itself is being deleted (again, be cautious of self-deleting threads as these delete themselves before terminating).
|