From nobody Mon Jul 27 16:17:55 2026 X-Original-To: dev-commits-src-all@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 4h83fX4Z6Dz6nBsk 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 4h83fW6Nl9z435s for ; Mon, 27 Jul 2026 16:17:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1785169075; 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=hlMQgeNEbbWfxIbgJ71a0VYgilQgG7xysH0nZP8cvROdft6wo79NxCrPtpL4f8JC3ulQNV KWUcw/Pfsft/bqP/e/rS+ilvwht+EAwRxYrl9ogPXA+z7kxiWqhm+DbGMqIiSch9jt5YIb iF7npw8LkQ+BbXOFTtaDoDYDTqzO/KTe2w5Yghh0cbVanPAOY922LKay5+fFJxWnjcAV65 CyLUoKX7TOnLo7PfcD2NLHh9mJURHahkIK8XOB44KwMOq8gcWgGfYnXeNbuxJNJtQy5e4+ ZoJ0EUaPas9gUi++ZWnWUF60YuQwfdCHAYwVr30URS6pJsOnXGBZPXX7Nmkpiw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1785169075; a=rsa-sha256; cv=none; b=Iy2Gf8wH00yald5fhJVZT1kI1h5PnfrBihkF1IPhOUshansdCCLUSH902vGm8jP2ExQJh0 44JtiQzpmuLJ0drwItTE52oQVknEeUwKOMA1yVLgpjlcTZdeLU9jwdF/KzPgEI+I1k5oLB Ja67n+V5LzHCLBP7RQexUkX0DZV1QFj+DXo3JdYF5m6Pvb1lkMcWN3eqR4R610OHcAMhKv TnH2xLzlS7ZEGTHIdUwJMGmWVlNHKmbyxsCQ7uaUqNYs6s36sCD8W+0C172W8CH3Fsu7cR nFmhXgYrv1vMhcEncNj53BWXXNjWLHg4meITb1vQ2CnCMnE1SA8CBb5bAlMO+w== 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=1785169075; 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=qwikdTQrBXuZZCod0z/sOiZ0xnhANkzsMi7Q3/T3EzTHv+SZWPz1AN3qzY3B2yu7Izh5nR J3ecU9jNtmnNGqdAlvN6KG1GpJY2TOdhd6OelAlgIMPxC91mjrKpeYZMTlDvPYMeTzmQ7l GTIi3fV8IYzHAxmIv/N9seTvaJZZ7847m+N9R8hiJjUe4xHAwxxsa0L5oUJu4R/GGTowTU 8L+9Cb+o/Af+ZCfGZ+BCvebbccZUry/S3vX49UIvhsqVgRylTV7plu1eiwhIirERoVKEEB tLC0L0UTFvYNLYxlnu+FQ8hvYhUoZuFBktjJ930kTduKeVDf9gmsZGcPUm/jpg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4h83fW5RFwz1FhS 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 all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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