From nobody Thu Jul 30 02:53:38 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 4h9YgC73zQz6mQV0 for ; Thu, 30 Jul 2026 02:53:43 +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 4h9YgC4ZPrz3Gfh for ; Thu, 30 Jul 2026 02:53:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1785380023; 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=09/GgiQ39hrrvJzFhQCWzQMOwqoBb7BE2kyHA0T8aI0=; b=V7z2Gi2LNaZIEXw1Ukg0+RgPEWyG7IBDupKQ3YI7ecD/ZAK0LUcefLQCFPZzytybCnw9G1 Z2p+S2cE231g34C5bkHOTWawRdtQ98ipc1KXdV2ML4GjFk94nQpBr8v5N2F7o27cQ3L8RB 6XzLMcvJB2FlWIjxgyRWBxbrJBNIPE6keo+v56+PgrKlm3c2SWHuokrEcQi/8unCselTAj MTurno9Eq9bjKhYiQpm7ulddz6WD+s/wN1xHx8eyKshMa9/zVRYPtRE6lPrC36ugDf2GRi 62KnEkgIV2ZxXYLt9tEyu5p5MaWXTbcPvEp3lbE/tagFUtzBaUNJIMGt1PpcIQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1785380023; a=rsa-sha256; cv=none; b=XYq8dDM4yM1wvTtd88odJMYpPUJBnrnPnQPz2nh7rJgYA+stsyZiCJR7MJ7V/nVs38CJTZ gmeBDgHPbz2lYOcm49S7fwSMc62M6rXnrpNx4eRCGgnU94+mQL55WySmZD56qp0SoWUQ4+ ph1shzwIsw+5w8AgZcCrSYXhaDStr5pn5NscVSqcOZAFaSj8QP/qfsuBhrIEvTUFapr5cm BPFYKHGPryBzBYw4rMl0mN63P6LhQttBBVwVKhYtWOvUoFKo8TLzHkhZyjXtH1CxWjrcR0 Y8gaIcfndzFTeucaf6ibCiy4uXHupWFMx9NRLoTaqNYGDbHyr1C0KGE6QxUdnw== 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=1785380023; 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=09/GgiQ39hrrvJzFhQCWzQMOwqoBb7BE2kyHA0T8aI0=; b=sDm6XGe3NQ/1+XAZVKYA7U9Z2BrGjrmIGUclPcxda2u3dsJ9oEN+z5V5ubkiml4MJTY7Ri gc7xLiVtcLriv8kW0Ay8///M2x9fP5bZogK4QXzfNA3fT5DD5ONSeGfJaGJm5MRRnLrNYv NdBEW3zO/m82pQHNHiHg8jtNJP8ETenDRRq0uTra3m5iznXEaAbVM5ZolvyO2OXHg8TcpL xdgmREF8zMtL5GBqMI8LrXkH8Ik0w7GDfTxFOqjDexyPS5TgZtVQ7zp5YUB21bvWbSiFeQ GoOMsqzqBHMOYdtDP6ePysvfBsZ7UAkaF66RpNxLNjPdAEac8oNdwWDNjLtTTQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4h9YgC346lzvLc for ; Thu, 30 Jul 2026 02:53:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1d469 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 30 Jul 2026 02:53:38 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 26cad57094d1 - stable/15 - pthread_cond_wait.3: describe spurious wakeups 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/stable/15 X-Git-Reftype: branch X-Git-Commit: 26cad57094d1088ddb94abb64b2c2eb7dc91f0f6 Auto-Submitted: auto-generated Date: Thu, 30 Jul 2026 02:53:38 +0000 Message-Id: <6a6abcb2.1d469.2a52855c@gitrepo.freebsd.org> The branch stable/15 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=26cad57094d1088ddb94abb64b2c2eb7dc91f0f6 commit 26cad57094d1088ddb94abb64b2c2eb7dc91f0f6 Author: Konstantin Belousov AuthorDate: 2026-07-25 20:02:24 +0000 Commit: Konstantin Belousov CommitDate: 2026-07-30 02:50:49 +0000 pthread_cond_wait.3: describe spurious wakeups (cherry picked from commit 3c6f63902b037e36648fae435d4d5f56f9dc389b) --- share/man/man3/pthread_cond_wait.3 | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/share/man/man3/pthread_cond_wait.3 b/share/man/man3/pthread_cond_wait.3 index c09e7aa68738..d26602c69cfc 100644 --- a/share/man/man3/pthread_cond_wait.3 +++ b/share/man/man3/pthread_cond_wait.3 @@ -45,13 +45,26 @@ variable specified by .Fa cond , and releases the mutex specified by .Fa mutex . -The waiting thread unblocks only after another thread calls +The waiting thread unblocks after another thread calls .Xr pthread_cond_signal 3 , or .Xr pthread_cond_broadcast 3 with the same condition variable, and the current thread reacquires the lock on .Fa mutex . +.Pp +It is possible that the +.Fn pthread_cond_wait +function returns without corresponding wakeup from either +.Fn pthread_cond_signal +or +.Fn pthread_cond_broadcast . +Such condition is called spurious wakeup, and is allowed by +.St -p1003.1-96 . +Applications should have a boolean expression used for each wait +on the condition variable, and recheck it after return from the +.Fn pthread_cond_wait +function. .Sh RETURN VALUES If successful, the .Fn pthread_cond_wait