History log of /freebsd/lib/libthr/thread/thr_cond.c (Results 1 – 25 of 88)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 8f86c108 12-Mar-2024 Brooks Davis <brooks@FreeBSD.org>

libthr: restore _pthread_cond_timedwait

The function was renamed to _thr_cond_timedwait in commit 0ab1bfc7b28f
and for some reason did not get the same __weak_reference treatment as
other _pthread_c

libthr: restore _pthread_cond_timedwait

The function was renamed to _thr_cond_timedwait in commit 0ab1bfc7b28f
and for some reason did not get the same __weak_reference treatment as
other _pthread_cond symbols.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D44244

show more ...


# f8bbbce4 06-Mar-2024 Konstantin Belousov <kib@FreeBSD.org>

libthr: remove explicit sys/cdefs.h includes

Sponsored by: The FreeBSD Foundation
MFC after: 1 week


Revision tags: release/13.3.0, release/14.0.0
# 1d386b48 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# 4d846d26 10-May-2023 Warner Losh <imp@FreeBSD.org>

spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD

The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of

spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD

The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with: pfg
MFC After: 3 days
Sponsored by: Netflix

show more ...


Revision tags: release/13.2.0, release/12.4.0, release/13.1.0
# c7904405 07-Apr-2022 Andrew Turner <andrew@FreeBSD.org>

Remove PAGE_SIZE from libthr

In libthr we use PAGE_SIZE when allocating memory with mmap and to check
various structs will fit into a single page so we can use this allocator
for them.

Ask the kern

Remove PAGE_SIZE from libthr

In libthr we use PAGE_SIZE when allocating memory with mmap and to check
various structs will fit into a single page so we can use this allocator
for them.

Ask the kernel for the page size on init for use by the page allcator
and add a new machine dependent macro to hold the smallest page size
the architecture supports to check the structure is small enough.

This allows us to use the same libthr on arm64 with either 4k or 16k
pages.

Reviewed by: kib, markj, imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34984

show more ...


Revision tags: release/12.3.0, release/13.0.0, release/12.2.0, release/11.4.0, release/12.1.0
# 0ab1bfc7 31-Jul-2019 Konstantin Belousov <kib@FreeBSD.org>

Avoid conflicts with libc symbols in libthr jump table.

In some corner cases of static linking and unexpected libraries order
on the linker command line, libc symbol might preempt the same libthr
sy

Avoid conflicts with libc symbols in libthr jump table.

In some corner cases of static linking and unexpected libraries order
on the linker command line, libc symbol might preempt the same libthr
symbol, in which case libthr jump table points back to libc causing
either infinite recursion or loop. Handle all of such symbols by
using private libthr names for them, ensuring that the right pointers
are installed into the table.

In collaboration with: arichardson
PR: 239475
Tested by: pho
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D21088

show more ...


Revision tags: release/11.3.0
# 2aaf9152 18-Mar-2019 Alan Somers <asomers@FreeBSD.org>

MFHead@r345275


# ff511f1f 11-Mar-2019 Enji Cooper <ngie@FreeBSD.org>

MFhead@r344996


# b16150ea 08-Mar-2019 Mark Johnston <markj@FreeBSD.org>

Have pthread_cond_destroy() return EBUSY if the condvar has waiters.

This is not required of a compliant implementation, but it's easy to
check for and helps improve compatibility with other common

Have pthread_cond_destroy() return EBUSY if the condvar has waiters.

This is not required of a compliant implementation, but it's easy to
check for and helps improve compatibility with other common
implementations. Moreover, it's consistent with our
pthread_mutex_destroy().

PR: 234805
Reviewed by: jhb, kib, ngie
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D19496

show more ...


Revision tags: release/12.0.0
# 3611ec60 18-Aug-2018 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r337646 through r338014.


# b6413b6d 18-Aug-2018 Pedro F. Giffuni <pfg@FreeBSD.org>

POSIX compliance improvements in the pthread(3) functions.

This basically adds makes use of the C99 restrict keyword, and also
adds some 'const's to four threading functions: pthread_mutexattr_getty

POSIX compliance improvements in the pthread(3) functions.

This basically adds makes use of the C99 restrict keyword, and also
adds some 'const's to four threading functions: pthread_mutexattr_gettype(),
pthread_mutexattr_getprioceiling(), pthread_mutexattr_getprotocol(), and
pthread_mutex_getprioceiling. The changes are in accordance to POSIX/SUSv4-2018.

Hinted by: DragonFlyBSD

Relnotes: yes
MFC after: 1 month
Differential Revision: D16722

show more ...


Revision tags: release/11.2.0
# 5e53a4f9 26-Nov-2017 Pedro F. Giffuni <pfg@FreeBSD.org>

lib: further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using mis-identified many licenses so this was mostly a manual - error
pr

lib: further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using mis-identified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

show more ...


Revision tags: release/10.4.0, release/11.1.0
# 1bde3b70 09-Dec-2016 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r309519 through r309757.


# 4dafad49 06-Dec-2016 Konstantin Belousov <kib@FreeBSD.org>

Do not leak curthread->inact_mtx when cancelling in pthread_cond_wait(3).

Leave robust-protected region before checking for cancellation by
calling _thr_testcancel(). Otherwise, if cancelling reque

Do not leak curthread->inact_mtx when cancelling in pthread_cond_wait(3).

Leave robust-protected region before checking for cancellation by
calling _thr_testcancel(). Otherwise, if cancelling request was
pending, the cancel handler is called with the dandling inact_mtx,
which triggers an assert if any mutex operation is performed by the
handler.

Reported and tested by: Dimitri Staessens <dimitri.staessens@intec.ugent.be>
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

show more ...


Revision tags: release/11.0.1, release/11.0.0
# c72ef5ea 01-Jun-2016 Conrad Meyer <cem@FreeBSD.org>

libthr: Use formatted PANIC()

No functional change, although _thread_printf() may be slightly less functional
or render some values differently from libc snprintf(3). No ABI change.

Reviewed by: k

libthr: Use formatted PANIC()

No functional change, although _thread_printf() may be slightly less functional
or render some values differently from libc snprintf(3). No ABI change.

Reviewed by: kib
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D6672

show more ...


# 6180f50b 29-May-2016 Konstantin Belousov <kib@FreeBSD.org>

Stop inlining the struct ucond definition into struct pthread_cond.
This avoids unneccessary casts and make the calls to _thr_ucond_*()
functions less questionable.

The c_spare field was not include

Stop inlining the struct ucond definition into struct pthread_cond.
This avoids unneccessary casts and make the calls to _thr_ucond_*()
functions less questionable.

The c_spare field was not included into struct pthread_cond, so the
change modifies libthr ABI for shared condvars. But since an off-page
does not legitimately contains any other data past the struct
pthread_cond, the change keeps shared condvars from pre- and post-
changed libthr compatible. Also note that the whole struct ucond was
never copied in or out by kernel.

For private condvars, the privately allocated memory was never exposed
outside libthr.

Sponsored by: The FreeBSD Foundation

show more ...


# 2a339d9e 17-May-2016 Konstantin Belousov <kib@FreeBSD.org>

Add implementation of robust mutexes, hopefully close enough to the
intention of the POSIX IEEE Std 1003.1TM-2008/Cor 1-2013.

A robust mutex is guaranteed to be cleared by the system upon either
thr

Add implementation of robust mutexes, hopefully close enough to the
intention of the POSIX IEEE Std 1003.1TM-2008/Cor 1-2013.

A robust mutex is guaranteed to be cleared by the system upon either
thread or process owner termination while the mutex is held. The next
mutex locker is then notified about inconsistent mutex state and can
execute (or abandon) corrective actions.

The patch mostly consists of small changes here and there, adding
neccessary checks for the inconsistent and abandoned conditions into
existing paths. Additionally, the thread exit handler was extended to
iterate over the userspace-maintained list of owned robust mutexes,
unlocking and marking as terminated each of them.

The list of owned robust mutexes cannot be maintained atomically
synchronous with the mutex lock state (it is possible in kernel, but
is too expensive). Instead, for the duration of lock or unlock
operation, the current mutex is remembered in a special slot that is
also checked by the kernel at thread termination.

Kernel must be aware about the per-thread location of the heads of
robust mutex lists and the current active mutex slot. When a thread
touches a robust mutex for the first time, a new umtx op syscall is
issued which informs about location of lists heads.

The umtx sleep queues for PP and PI mutexes are split between
non-robust and robust.

Somewhat unrelated changes in the patch:
1. Style.
2. The fix for proper tdfind() call use in umtxq_sleep_pi() for shared
pi mutexes.
3. Removal of the userspace struct pthread_mutex m_owner field.
4. The sysctl kern.ipc.umtx_vnode_persistent is added, which controls
the lifetime of the shared mutex associated with a vnode' page.

Reviewed by: jilles (previous version, supposedly the objection was fixed)
Discussed with: brooks, Martin Simmons <martin@lispworks.com> (some aspects)
Tested by: pho
Sponsored by: The FreeBSD Foundation

show more ...


# 876d357f 11-Apr-2016 Glen Barber <gjb@FreeBSD.org>

MFH

Sponsored by: The FreeBSD Foundation


# 32793011 08-Apr-2016 Konstantin Belousov <kib@FreeBSD.org>

Use __FBSDID() for .c files from lib/libthr/thread.

Sponsored by: The FreeBSD Foundation


# 9e821f27 08-Apr-2016 Konstantin Belousov <kib@FreeBSD.org>

Assert that the lock objects put into the off-page, fit into the page.

Sponsored by: The FreeBSD Foundation


Revision tags: release/10.3.0
# 82aa34e6 04-Mar-2016 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r296007 through r296368.


# 52259a98 02-Mar-2016 Glen Barber <gjb@FreeBSD.org>

MFH

Sponsored by: The FreeBSD Foundation


# 1bdbd705 28-Feb-2016 Konstantin Belousov <kib@FreeBSD.org>

Implement process-shared locks support for libthr.so.3, without
breaking the ABI. Special value is stored in the lock pointer to
indicate shared lock, and offline page in the shared memory is
alloca

Implement process-shared locks support for libthr.so.3, without
breaking the ABI. Special value is stored in the lock pointer to
indicate shared lock, and offline page in the shared memory is
allocated to store the actual lock.

Reviewed by: vangyzen (previous version)
Discussed with: deischen, emaste, jhb, rwatson,
Martin Simmons <martin@lispworks.com>
Tested by: pho
Sponsored by: The FreeBSD Foundation

show more ...


Revision tags: release/10.2.0
# 9268022b 19-Nov-2014 Simon J. Gerraty <sjg@FreeBSD.org>

Merge from head@274682


Revision tags: release/10.1.0
# 4e27d36d 17-Sep-2014 Neel Natu <neel@FreeBSD.org>

IFC @r271694


1234