File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -307,7 +307,14 @@ schedule_alarm(TimestampTz now)
307307 * signal is still coming.
308308 *
309309 * Other race conditions involved with setting/checking signal_pending
310- * are okay, for the reasons described above.
310+ * are okay, for the reasons described above. One additional point is
311+ * that the signal handler could fire after we set signal_due_at, but
312+ * still before the setitimer() call. Then the handler could
313+ * overwrite signal_due_at with a value it computes, which will be the
314+ * same as or perhaps later than what we just computed. After we
315+ * perform setitimer(), the net effect would be that signal_due_at
316+ * gives a time later than when the interrupt will really happen;
317+ * which is a safe situation.
311318 */
312319 signal_due_at = nearest_timeout ;
313320 signal_pending = true;
You can’t perform that action at this time.
0 commit comments