From: cheloha Date: Sat, 31 Dec 2022 16:06:24 +0000 (+0000) Subject: timeout: rename "timeout_at_ts" to "timeout_abs_ts" X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=e3c5fa921ef394179421471c88eb2be26d8a6692;p=openbsd timeout: rename "timeout_at_ts" to "timeout_abs_ts" I think "abs" ("absolute timeout") is a better mnemonic than "at" ("at the given time"). The interface is undocumented and there are only two callers, so renaming it is not a big deal. probably ok kn@ --- diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c index 8a274cc0fc8..a86e272a253 100644 --- a/sys/kern/kern_time.c +++ b/sys/kern/kern_time.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_time.c,v 1.159 2022/12/05 23:18:37 deraadt Exp $ */ +/* $OpenBSD: kern_time.c,v 1.160 2022/12/31 16:06:24 cheloha Exp $ */ /* $NetBSD: kern_time.c,v 1.20 1996/02/18 11:57:06 fvdl Exp $ */ /* @@ -548,7 +548,7 @@ setitimer(int which, const struct itimerval *itv, struct itimerval *olditv) if (which == ITIMER_REAL) { if (timespecisset(&its.it_value)) { timespecadd(&its.it_value, &now, &its.it_value); - timeout_at_ts(&pr->ps_realit_to, &its.it_value); + timeout_abs_ts(&pr->ps_realit_to,&its.it_value); } else timeout_del(&pr->ps_realit_to); } @@ -691,7 +691,7 @@ realitexpire(void *arg) while (timespeccmp(&tp->it_value, &cts, <=)) timespecadd(&tp->it_value, &tp->it_interval, &tp->it_value); if ((pr->ps_flags & PS_EXITING) == 0) - timeout_at_ts(&pr->ps_realit_to, &tp->it_value); + timeout_abs_ts(&pr->ps_realit_to, &tp->it_value); out: mtx_leave(&pr->ps_mtx); diff --git a/sys/kern/kern_timeout.c b/sys/kern/kern_timeout.c index f1d5f723971..ef72572c36c 100644 --- a/sys/kern/kern_timeout.c +++ b/sys/kern/kern_timeout.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_timeout.c,v 1.89 2022/12/05 23:18:37 deraadt Exp $ */ +/* $OpenBSD: kern_timeout.c,v 1.90 2022/12/31 16:06:24 cheloha Exp $ */ /* * Copyright (c) 2001 Thomas Nordin * Copyright (c) 2000-2001 Artur Grabowski @@ -380,7 +380,7 @@ timeout_add_nsec(struct timeout *to, int nsecs) } int -timeout_at_ts(struct timeout *to, const struct timespec *abstime) +timeout_abs_ts(struct timeout *to, const struct timespec *abstime) { struct timespec old_abstime; int ret = 1; diff --git a/sys/sys/timeout.h b/sys/sys/timeout.h index bdb437c4c70..56fb0dde9eb 100644 --- a/sys/sys/timeout.h +++ b/sys/sys/timeout.h @@ -1,4 +1,4 @@ -/* $OpenBSD: timeout.h,v 1.46 2022/11/11 18:09:58 cheloha Exp $ */ +/* $OpenBSD: timeout.h,v 1.47 2022/12/31 16:06:24 cheloha Exp $ */ /* * Copyright (c) 2000-2001 Artur Grabowski * All rights reserved. @@ -111,7 +111,7 @@ int timeout_add_msec(struct timeout *, int); int timeout_add_usec(struct timeout *, int); int timeout_add_nsec(struct timeout *, int); -int timeout_at_ts(struct timeout *, const struct timespec *); +int timeout_abs_ts(struct timeout *, const struct timespec *); int timeout_del(struct timeout *); int timeout_del_barrier(struct timeout *);