title: alarm stop's when signal arrive
body: <p>I'm trying to combine signal and alarm.
  I have 2 Processes. 1 is receiving input from the user, and write it into pipe and then sending signal (SIGUSR2) to the other Process.
  In the other Process, i have infinite loop which Produces alarm every second.
  So my program should handle both alarm signal's and SIGUSR2 signals.
  The alarm handle work fine, but when a signal arrive and the signal handler active it seem to don't return to the loop that Produce alarm's.
  I read the man page of alarm and signal's and didn't find anything. It says that the signal handler function should return to the original code, but it doesn't.
  I like to know why the code don't return to the loop after the signal handler, and how to force it to do the alarm handler function every second even if signal's received meanwhile.</p>
  
  <p>this is the loop:</p>
  
  <pre><code>while (1) {
  signal (SIGUSR2 , signal_hand);
  signal (SIGALRM , alarm_hand);
  alarm (1);
  pause();
  }
  </code></pre>
  
  <p>This is the signal handler function:</p>
  
  <pre><code>void signal_hand (int sig) {
  // reading from the pipe and doing things accordingly
  ...
  }
  </code></pre>
  
  <p>And this is the alarm handler function:</p>
  
  <pre><code>void alarm_hand (int sig) {
  // doing things
  ...
  }
  </code></pre>