Skip to content

Commit

Permalink
[LibOS] Error and die on timer event re-registration failure in callback
Browse files Browse the repository at this point in the history
Signed-off-by: Kailun Qin <kailun.qin@intel.com>
  • Loading branch information
kailun-qin committed Mar 4, 2024
1 parent fac30bc commit 4afc550
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions libos/src/sys/libos_alarm.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,16 @@ static void signal_itimer(IDTYPE caller, void* arg) {

spinlock_unlock(&g_real_itimer_lock);

if (next_reset)
install_async_event(/*object=*/NULL, next_reset, &signal_itimer, /*arg=*/NULL);
if (next_reset) {
int64_t ret = install_async_event(/*object=*/NULL, next_reset, &signal_itimer,
/*arg=*/NULL);
if (ret < 0) {
log_error(
"failed to re-enqueue the next timer event initially set up by 'setitimer()': %s",
unix_strerror(ret));
die_or_inf_loop();
}
}

signal_current_proc(SIGALRM);
}
Expand Down

0 comments on commit 4afc550

Please sign in to comment.