From nobody Tue Nov 17 01:09:52 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 4jT68c4HqLz71PxX for ; Tue, 17 Nov 2026 01:09:52 +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) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jT68c1wtmz3CXM for ; Tue, 17 Nov 2026 01:09:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794877792; 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=8LjWStujxTO3xU4Olge5pK2S3msA17KXOGuJiBoEVeI=; b=M5ltX+Bw/lG0Q0oI6qbrYidmMRsgK3ePlR4oj5k8zr9oY4dtGg2KMhAPKk480Lmk4Op9qJ 6QC+PKLW/qnpXx/XWAF2mNIU8dyIuxzDRFSozxN7+fFtjViAXpyDTkGqXAenzDngLsoPEJ mhX79r97nDFCO6GlLTKC2GqGkLyG//ofTFwiHI1O615O21IgXg0VKDUaL9Fng5e3vOCRJN pRnih113OncUT+Rv/XQ4eVJ1BSUJWvVgNXL+WDz0WKNEiGqMfLnd6nMPoA8MYgAJYhHID2 xv3PNP3vxA9Ov+d4jSSmbnF8A9Sf/Ce+G+88/P63NrjOIrDYx79h6LZUAtm88w== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1794877792; b=RuzDIEkXdJjCO87agFCdVTiI4N5bhq3X6XRnSi8uYUkslVMFPJkY8dSHBlDuCA4dqtXxoP RnrkjEhSJ39gbR/M/WQ+BXIHk3D9a9bqHbSgv53be5SDy5TwfV7GrsIfXkvcPDOX2GQBN2 ULFqj2KbZ+wgbFmCjCzdcjzoL3wgo/5fjy7p1D34UT4UVmWSrnevbwanIibOEt1F02s3CP HYI5bX7VheMOlnuBHANIuWDD1Sqo55GKr+mXCYL60r4XBbXq9LR+MR/jr3aMjhT4Aen7AL FKct6V0w724lmzaY6DGnsRt3uaixxnIhjK3RU1YcQ6JATw7kNvO4n4Z+7aN17w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794877792; 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=8LjWStujxTO3xU4Olge5pK2S3msA17KXOGuJiBoEVeI=; b=hhsBM7NS8eulehGw6T24y6p2FwlulVW5Lpbh1zFOOGGjqtJd8lxQLI/nHaYMzLDmbshFCB 8J/omkZsTD8kmWWthzA2HAM/UJMlQAD2ymnQYE8DWdv+sPUQvw5T4kSD/zttmeo5/Nj0pD 79wo5PHtHcyEHNPKgKJSu7v7IIn14Tc6XY7ZiyMhVsq8Ng9CUXRGpBETI/cv846lL6Xmt8 52Ne5BDOA8o13b/WsKXyij+Gya1y49T/J7WJwTL4sTRdNfmEiyqkccT5CZ+6B5FJTmoNq0 76cYjEjeCSfIHKsOCAKfAs+W75FZfSAyfADXpi/RZ8ncOVYhJFRXKMmzM2rXQQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4jT68c1S0BzJCD for ; Tue, 17 Nov 2026 01:09:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 18a4 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 17 Nov 2026 01:09:52 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: d0d8362be2ed - stable/15 - pthread_mutex_clocklock.3: document List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all X-BeenThere: dev-commits-src-all@freebsd.org List-Id: Commit messages for all branches of the src repository 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: d0d8362be2ed97a2536e39ae614e959a54722a26 Auto-Submitted: auto-generated Date: Tue, 17 Nov 2026 01:09:52 +0000 Message-Id: <6afba960.18a4.21a4613f@gitrepo.freebsd.org> The branch stable/15 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=d0d8362be2ed97a2536e39ae614e959a54722a26 commit d0d8362be2ed97a2536e39ae614e959a54722a26 Author: Konstantin Belousov AuthorDate: 2026-11-05 18:32:08 +0000 Commit: Konstantin Belousov CommitDate: 2026-11-17 00:25:03 +0000 pthread_mutex_clocklock.3: document (cherry picked from commit 1c08e2b915bf44dacd5b14ee8d8214ef40946c65) --- share/man/man3/Makefile | 1 + share/man/man3/pthread_mutex_timedlock.3 | 70 ++++++++++++++++++++++++++------ 2 files changed, 59 insertions(+), 12 deletions(-) diff --git a/share/man/man3/Makefile b/share/man/man3/Makefile index 874926bda0f1..4d80fea05b88 100644 --- a/share/man/man3/Makefile +++ b/share/man/man3/Makefile @@ -514,6 +514,7 @@ PTHREAD_MLINKS+=pthread_condattr.3 pthread_condattr_destroy.3 \ PTHREAD_MLINKS+=pthread_cond_timedwait.3 pthread_cond_clockwait.3 PTHREAD_MLINKS+=pthread_getconcurrency.3 pthread_setconcurrency.3 PTHREAD_MLINKS+=pthread_multi_np.3 pthread_single_np.3 +PTHREAD_MLINKS+=pthread_mutex_timedlock.3 pthread_mutex_clocklock.3 PTHREAD_MLINKS+=pthread_mutexattr.3 pthread_mutexattr_destroy.3 \ pthread_mutexattr.3 pthread_mutexattr_getprioceiling.3 \ pthread_mutexattr.3 pthread_mutexattr_getprotocol.3 \ diff --git a/share/man/man3/pthread_mutex_timedlock.3 b/share/man/man3/pthread_mutex_timedlock.3 index 59d9c3883637..16aadf76430b 100644 --- a/share/man/man3/pthread_mutex_timedlock.3 +++ b/share/man/man3/pthread_mutex_timedlock.3 @@ -26,6 +26,7 @@ .Dt PTHREAD_MUTEX_TIMEDLOCK 3 .Os .Sh NAME +.Nm pthread_mutex_clocklock , .Nm pthread_mutex_timedlock .Nd lock a mutex without blocking indefinitely .Sh LIBRARY @@ -34,33 +35,58 @@ .In pthread.h .In time.h .Ft int +.Fo pthread_mutex_clocklock +.Fa "pthread_mutex_t *restrict mutex" +.Fa "clockid_t clockid" +.Fa "const struct timespec *restrict abs_timeout" +.Fc +.Ft int .Fo pthread_mutex_timedlock .Fa "pthread_mutex_t *restrict mutex" .Fa "const struct timespec *restrict abs_timeout" .Fc .Sh DESCRIPTION The -.Fn pthread_mutex_timedlock -function will lock +.Fn pthread_mutex_clocklock +function locks .Fa mutex . -If it is already locked the calling thread will block until -the mutex becomes available or -the timeout, -specified by abs_timeout, -expires. -The time of the timeout is an absolute time and -is not relative to the current time. +If the mutex is already locked, the calling thread blocks until the +mutex becomes available or the timeout expires. +The timeout expires when the clock specified by +.Fa clockid +reaches or passes the absolute time +.Fa abs_timeout ; +it is not relative to the current time. +If the mutex can be locked immediately, the call does not fail +with a timeout, and +.Fa abs_timeout +and +.Fa clockid +are not checked for validity. +.Pp +The +.Fn pthread_mutex_timedlock +function is equivalent to +.Fn pthread_mutex_clocklock +with +.Fa clockid +set to +.Dv CLOCK_REALTIME . .Sh RETURN VALUES If successful, +.Fn pthread_mutex_clocklock +and .Fn pthread_mutex_timedlock will return zero, otherwise an error number will be returned to indicate the error. .Sh ERRORS The +.Fn pthread_mutex_clocklock +and .Fn pthread_mutex_timedlock -function will fail if: +functions will fail if: .Bl -tag -width Er -.It Bq "Er ENOTRECOVERABLE" +.It Bq Er ENOTRECOVERABLE The .Fa mutex was created with the protocol attribute having the @@ -76,6 +102,17 @@ greater than or equal to 1 billion. The .Fa mutex parameter is invalid. +.It Bq Er EINVAL +The +.Fa clockid +parameter is invalid. +The +.Dv CLOCK_REALTIME +and +.Dv CLOCK_MONOTONIC +clocks are always supported; see +.Xr _umtx_op 2 +for the full list of accepted clocks. .It Bq Er ETIMEDOUT The .Fa mutex @@ -112,5 +149,14 @@ is not recoverable. .Sh STANDARDS The .Fn pthread_mutex_timedlock -function is expected to conform to +function conforms to .St -p1003.1-96 . +The +.Fn pthread_mutex_clocklock +function conforms to +.St -p1003.1-2024 . +.Sh HISTORY +The +.Fn pthread_mutex_clocklock +function first appeared in +.Fx 16.0 .