pthread_setname_np - a few notes

During debugging a particularly evasive problem I needed to see the CPU usage of each thread in a program. My cunning plan was to use pthread_setname_np() so I can see the thread names of a program and their CPU use in htop. It works but there are two gotchas:

I hope this helps someone some day.