From nobody Mon Jul 27 16:17:55 2026 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4h83fX4lFKz6nBng for ; Mon, 27 Jul 2026 16:17:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4h83fX0kqPz43Dp for ; Mon, 27 Jul 2026 16:17:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1785169076; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lLJ+j8Egzkw+0/gR/dHdK7rdplC6HE89pjE/JPpn5T8=; b=VpWXAvU0t3+qVR6VwEH8I6mqzY2cgU6GUwa1fTOOXU1whYUD1e+6CtFZt0xK7ylNg3BPsV /kvySnlcdvVicwFlLsKqxDsOPso8gvHHCjKLO/HQkEBKE+hj1ib2+ywt2MEnwBvEAwd9IS 2xMjOMn+cxyd6RFr208wYFljcrALbVu18KzRXzpWeDjwZs0nmvoiwHmFDz0aQtGMPZD5dZ cNh06e+/o2hKiA3OFNQ28cwUIHRhdPlw5oKbvo5gpAeOrtLjW7pDk+Ciz44Q1n6ws557co D3VB8b9CGbGg61vkQC/dou0T1eI5ehGO+MVJoO/Px3uihGODtjC6tXJvAa1IHg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1785169076; a=rsa-sha256; cv=none; b=gmOgpLv2p/qqUNPy1CIiwKKMUrCaIshW+TFml8ISokwdDA9Efse43t2eUxen9P01XV7uFT Hv6oD8sBItwHT+rs+0U2lLfeqEim5cxPbrWC/mrPWlEOfYfL76VjM1Yezh10lGUcJmBT2z bsmhT0WDbCdMEwclvXCifBVK21fyHYfS5j68dUZM/+lvnkj7R/r2wpXM4dZZJNm/mb8kpB QelKfQMN81fQWJmkIMv4MvktNwJi83xsF+iU975AYFzQbkuINAWB0xDNynq68GrAaUtxRM F2sl9lK6nEKv9+vllEWZfLupdri27uvme5gGnm1dbCNvp1ZAo4jIt17uSz76DQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1785169076; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lLJ+j8Egzkw+0/gR/dHdK7rdplC6HE89pjE/JPpn5T8=; b=DXkeHzyomqLh1T83Je4fNjMdqrdXVtl2MJaVL+VPVB5jjJgP3pc8c/DdgH63CQ3jSf4Lsd Xd7oxL51RlFI+CqD6TPsV+7BgvwMB195k79/2AYWnlCcEWrkp0L45NZcQNhERg+VM7jGjw hqqq4I9zhyJJQnCUT9J+lJSMS0OvNxgkHRpVzg3kOxtyILIUtRFk7eeLWGDBDocLIXbAld tYzVwsF2ZGfiqIhXaDNN8wMfuIk4EIPgNJBSWGDIv0FTYd5MMB9OMy7I73LH2t2Vf7eoiW v9/SKVFZOfF16RRehIVoOf376AI0qObcfAUiq7tFoeu5T5AC6CuV+1Pdx/Ow3w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4h83fW5SDNz1FMX for ; Mon, 27 Jul 2026 16:17:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1e1cb by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 27 Jul 2026 16:17:55 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 149d3e5fcb76 - main - libthr/thread/thr_cond.c: some style List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 149d3e5fcb76bff86d4343b7378258e9a6d3e25b Auto-Submitted: auto-generated Date: Mon, 27 Jul 2026 16:17:55 +0000 Message-Id: <6a6784b3.1e1cb.52c8dca5@gitrepo.freebsd.org> The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=149d3e5fcb76bff86d4343b7378258e9a6d3e25b commit 149d3e5fcb76bff86d4343b7378258e9a6d3e25b Author: Konstantin Belousov AuthorDate: 2026-07-26 00:07:37 +0000 Commit: Konstantin Belousov CommitDate: 2026-07-27 16:17:28 +0000 libthr/thread/thr_cond.c: some style Also use bool for the 'cancel' argument for cond_wait_common(). Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D58463 --- 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 int