thread local storage
adding log in pthread_once()
how to cancel and cleanup thread