From nobody Thu Jul 30 02:53:38 2026 X-Original-To: dev-commits-src-branches@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 4h9Yg64L1Qz6mQcg for ; Thu, 30 Jul 2026 02:53:38 +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 4h9Yg62gk7z3GfK for ; Thu, 30 Jul 2026 02:53:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1785380018; 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=cxvBDJOnFlO44vNG8aV+483ll+7nY1xxHnBvMt/xSlKvd4WLMOf7qwswBzxIKOT3T7ZYWG aLGsbRodQjO4Hn2a8Uwx84hrkd4x43SAgztFEDguI9TrHl3fmi/ZQxYre7KA9Qs9iR38GT Nnqa/oAl/Kr7APSKVVU4r7D+LxtYraSSLFxKi+OKi7VqN2qgVApTlvMzeS4HcGJk7D4DGW Ju+QbpaqHb193TBuZo3txVThkY7nhStKtIRVDCg2d+01HKM/3/mGdZ3S27mtarO31pG7J4 jY2/dPVXlMAx02/q3FQ5gqD5RJt5wPcHNVCCd5rU7TipI0Ai+xKWz89zaen1Kw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1785380018; a=rsa-sha256; cv=none; b=gHPbBZFRHqZ6iEtq7SqgSUUlLRCZ64ZvkbiTht3q7+FoXypdd3ImHcQdw+ULHbmK1uAr/g hrtQBKEAq5EfHl4LbH3x0Cd9R++B60lcEZu4YqSGWlh9eOnalGGTu3+aYp/iZe+NRHA0pq jFXpMEP4FzvaSAytW+NhEiM4gFKIPstna7D5QHTaqTtTS6LlTOxtZreHQtbKoTjspK9msa HKlRkeYdQOu9RavqppSQgehaT9MVG38WAdQw1ZsDdy9DVKtUzarRSRd2IWMVIxMx0xRoiP 9hMuXVxexXYMvTPWcp5BKXdAzJWn81l9EU3GZ/EEC/2B6kPKeOe+l8Sw3f5uhQ== 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=1785380018; 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=KGU7E/5MFFqtXgGVOz7vF+dlb1ROO5XUd+e+kDkUAJyigFQ521PhW5QVAisxgKd8Pw3aq/ jGK/JF18DvC5snu8D5J6jZkUL2MJInBH4mqOaNol2QnHpzbf2lTK5wRUeIjZWKmXarVWMl kOkk5SUwcllVl+64YokNk1cp+nsL9O0O0GYOht6TtVtD3VTvAyZ6x1YUMAWxdIkjfQCfVo GC7O5YKondamXolYtb1lS6VKLr+js1sriVXlJQ5Dv1BqALL4ox/PACR/mbkYpcyTDUJw3s 7QTrMWkyFKKlDuOuKBXcuFs4TxfkiCTCelFmNuP3vDlB/f4W0+Z6wy1WjqBmXA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4h9Yg61K69zv1L for ; Thu, 30 Jul 2026 02:53:38 +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: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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