Oops.. I forgot putting my suggestion. Sorry. How about substituting sigalrm_delivered to true in the reschedule_timeouts()? Maybe this processing looks strange, so some comments should be put too. Here is an example:
/* Reschedule the interrupt, if any timeouts remain active. */ if (num_active_timeouts > 0) + { + /* + * sigalrm_delivered is set to true, + * because any intrreputions might be occured. + */ + sigalrm_delivered = true; schedule_alarm(GetCurrentTimestamp()); + } } ```