aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJake Freeland <jfree@FreeBSD.org>2026-03-20 06:33:54 +0000
committerJake Freeland <jfree@FreeBSD.org>2026-03-20 07:15:08 +0000
commitb11fba41265ae132acfb05587a6dbf60334d3279 (patch)
treecc44aea781fa6646681a4003d929541d14450061 /sys
parent0e8f351be7935729bf67dc1b7aa4d178cf154931 (diff)
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/sys_timerfd.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/sys/kern/sys_timerfd.c b/sys/kern/sys_timerfd.c
index f2a66e21cd63..e4d00f224505 100644
--- a/sys/kern/sys_timerfd.c
+++ b/sys/kern/sys_timerfd.c
@@ -118,6 +118,14 @@ timerfd_getboottime(struct timespec *ts)
TIMEVAL_TO_TIMESPEC(&tv, ts);
}
+static void
+timerfd_wakeup(struct timerfd *tfd)
+{
+ wakeup(&tfd->tfd_count);
+ selwakeup(&tfd->tfd_sel);
+ KNOTE_LOCKED(&tfd->tfd_sel.si_note, 0);
+}
+
/*
* Call when a discontinuous jump has occured in CLOCK_REALTIME and
* update timerfd's cached boottime. A jump can be triggered using
@@ -172,6 +180,8 @@ timerfd_jumped(void)
}
tfd->tfd_boottim = boottime;
+ if ((tfd->tfd_jumped & TFD_JUMPED) != 0)
+ timerfd_wakeup(tfd);
mtx_unlock(&tfd->tfd_lock);
}
mtx_unlock(&timerfd_list_lock);
@@ -418,9 +428,7 @@ timerfd_expire(void *arg)
timespecclear(&tfd->tfd_time.it_value);
}
- wakeup(&tfd->tfd_count);
- selwakeup(&tfd->tfd_sel);
- KNOTE_LOCKED(&tfd->tfd_sel.si_note, 0);
+ timerfd_wakeup(tfd);
}
int