Refactored signal handling and masking
Entrance: handle SIGUSR1 signal (wake up after posting request)