From nobody Mon Jul 27 16:12:35 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 4h83XS6879z6nBf5 for ; Mon, 27 Jul 2026 16:12:40 +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 4h83XS58Wfz42N1 for ; Mon, 27 Jul 2026 16:12:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1785168760; 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=rQCD8RZzwbtPINB/h5YXcGSyykHo2NHtsnWLNgEiMEo=; b=lqi73MP+B+oTYOW+GNe6JQfLHSdJ276gCh/wLdc32LQAMRLczB6r4ZtR6O29XItS7xIVMB +kttYSAP224z57DYJpmgQnXR73ONXD/JddcJ7ruNQBXB5hFGBfZxX24LaEsdXIzO8noR9z P6rH0hS+SF8FlJ4KhXBHs9iWTsPHzox//FtW8tjIZFnsNEC1TudyGtB67K1xQ7eTNbDA2f 8MKNhy9K/GeLGtAT2MMQSDoFMbhbL611hbWELhCp77sTr+7rgaN0GEKpFw5YhBKS7RXC9n f3J8KsP/By3a6V5cMKw0ySYCiqWutfxGwFGGZ7RPEehLIIXssAGF2GcbCDneSA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1785168760; a=rsa-sha256; cv=none; b=bgZVzpgIoVHrr+m9rwuO5tnJFBGqIDT8Siioekqv5j/68LQhB0LuXyNinQBzyzGyR4PwVD fExWMHup0jQIaMc5YVOX08LTGvPq/PVTvhmzUwi6so7dDL37/onDzNdNtN6xo3zHWYPxDe PiDwNmn+E4U1Ki5JfvxwWud3Sz7SdQTS7gdQ2kE5gRrpg+SZ4+G6ySAkRNt9WU+3tblDfq QCt0s1nm+Qi4ia66gzZTPwn/0VbF/MzDMPmufh1HyMePoxjoaDHuDg1Ufl4dWMr7CVnn2C cm2LDbdpJO0wX+qTIaqrZkhShflEmaJUGov5mKpjRWRo+6BgjHt38XdiW8ogfA== 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=1785168760; 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=rQCD8RZzwbtPINB/h5YXcGSyykHo2NHtsnWLNgEiMEo=; b=lO8mlDIBeG1mDLiGSfhcksC3RqqIDjb3RboPrfvmU0ML40bHQTmOeb8on7Vv9UMrzgeau1 GPOh/mnHkAzxStf5Uxj6Q9a86u55RBH83cVGaOMnkihh0TZYgqSqUCf/kidElfv1lXb+Ho 67a5Kk6xAJGR0VWBFpCJERr1Sles4X7oLN9wHcy0uVFUp2XCo+NtoC4peH0n699d0DZozx TLwW0ffBXSkXJfZKJotzqfO0kU1VGIJjFrzuTw20W0AkV9u0mwEg3F13K/KIamRrn9kY+g q5HA8/wUfKadKPq/M6r4HNSvneueW8icqltS1djBLfgaQe4Jt0vKFNVCQVH1Wg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4h83XS44bPz1FPs for ; Mon, 27 Jul 2026 16:12:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1dc99 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 27 Jul 2026 16:12:35 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 3c6f63902b03 - main - 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/main X-Git-Reftype: branch X-Git-Commit: 3c6f63902b037e36648fae435d4d5f56f9dc389b Auto-Submitted: auto-generated Date: Mon, 27 Jul 2026 16:12:35 +0000 Message-Id: <6a678373.1dc99.30c0735b@gitrepo.freebsd.org> The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=3c6f63902b037e36648fae435d4d5f56f9dc389b commit 3c6f63902b037e36648fae435d4d5f56f9dc389b Author: Konstantin Belousov AuthorDate: 2026-07-25 20:02:24 +0000 Commit: Konstantin Belousov CommitDate: 2026-07-27 16:12:12 +0000 pthread_cond_wait.3: describe spurious wakeups Reviewed by: markc Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D58458 --- 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