Use pthread_sigmask instead of sigprocmask