Date: Mon, 03 Aug 2026 00:25:32 +0000 From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: d32bf064e951 - stable/15 - libthr/thread/thr_cond.c: some style Message-ID: <6a6fdffc.1ca0e.76eae454@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch stable/15 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=d32bf064e951837cf815062afa3bfcc24279ebae commit d32bf064e951837cf815062afa3bfcc24279ebae Author: Konstantin Belousov <kib@FreeBSD.org> AuthorDate: 2026-07-26 00:07:37 +0000 Commit: Konstantin Belousov <kib@FreeBSD.org> CommitDate: 2026-08-03 00:23:15 +0000 libthr/thread/thr_cond.c: some style (cherry picked from commit 149d3e5fcb76bff86d4343b7378258e9a6d3e25b) --- lib/libthr/thread/thr_cond.c | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/lib/libthr/thread/thr_cond.c b/lib/libthr/thread/thr_cond.c index 0eb3dac068ca..f8c9118968bb 100644 --- a/lib/libthr/thread/thr_cond.c +++ b/lib/libthr/thread/thr_cond.c @@ -46,11 +46,11 @@ _Static_assert(sizeof(struct pthread_cond) <= THR_PAGE_SIZE_MIN, /* * Prototypes */ -int __pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex, - const struct timespec * abstime); +int __pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex, + const struct timespec * abstime); static int cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr); static int cond_wait_common(pthread_cond_t *cond, pthread_mutex_t *mutex, - const struct timespec *abstime, int cancel); + const struct timespec *abstime, bool cancel); static int cond_signal_common(pthread_cond_t *cond); static int cond_broadcast_common(pthread_cond_t *cond); @@ -202,7 +202,7 @@ _thr_cond_destroy(pthread_cond_t *cond) */ static int cond_wait_kernel(struct pthread_cond *cvp, struct pthread_mutex *mp, - const struct timespec *abstime, int cancel) + const struct timespec *abstime, bool cancel) { struct pthread *curthread; int error, error2, recurse, robust; @@ -274,7 +274,7 @@ cond_wait_kernel(struct pthread_cond *cvp, struct pthread_mutex *mp, static int cond_wait_user(struct pthread_cond *cvp, struct pthread_mutex *mp, - const struct timespec *abstime, int cancel) + const struct timespec *abstime, bool cancel) { struct pthread *curthread; struct sleepqueue *sq; @@ -350,12 +350,12 @@ cond_wait_user(struct pthread_cond *cvp, struct pthread_mutex *mp, static int cond_wait_common(pthread_cond_t *cond, pthread_mutex_t *mutex, - const struct timespec *abstime, int cancel) + const struct timespec *abstime, bool cancel) { struct pthread *curthread = _get_curthread(); struct pthread_cond *cvp; struct pthread_mutex *mp; - int error; + int error; CHECK_AND_INIT_COND @@ -381,16 +381,14 @@ cond_wait_common(pthread_cond_t *cond, pthread_mutex_t *mutex, int _thr_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex) { - - return (cond_wait_common(cond, mutex, NULL, 0)); + return (cond_wait_common(cond, mutex, NULL, false)); } int __thr_cond_wait(pthread_cond_t * __restrict cond, pthread_mutex_t * __restrict mutex) { - - return (cond_wait_common(cond, mutex, NULL, 1)); + return (cond_wait_common(cond, mutex, NULL, true)); } int @@ -398,24 +396,22 @@ _thr_cond_timedwait(pthread_cond_t * __restrict cond, pthread_mutex_t * __restrict mutex, const struct timespec * __restrict abstime) { - if (abstime == NULL || abstime->tv_sec < 0 || abstime->tv_nsec < 0 || abstime->tv_nsec >= 1000000000) return (EINVAL); - return (cond_wait_common(cond, mutex, abstime, 0)); + return (cond_wait_common(cond, mutex, abstime, false)); } int __pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex, const struct timespec *abstime) { - if (abstime == NULL || abstime->tv_sec < 0 || abstime->tv_nsec < 0 || abstime->tv_nsec >= 1000000000) return (EINVAL); - return (cond_wait_common(cond, mutex, abstime, 1)); + return (cond_wait_common(cond, mutex, abstime, true)); } static inthome | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6a6fdffc.1ca0e.76eae454>
