doing sigprocmask critical section