Unfortunately pthread attributes need to be set at creation time, so by the time you have a pthread pointer it's too late.
pthread_sigmask always operates on the current thread.
The usual technique is to set the pthread sigmask and then spawn the thread, to avoid the obvious race. But it's risky to assume that `std::thread` won't manipulate the sigmask by itself.