History log of /haiku/headers/posix/threads.h
Revision Date Author Comments
# d9e8ef7f 10-Apr-2023 Augustin Cavalier <waddlesplash@gmail.com>

threads.h: Fix value of ONCE_FLAG_INIT.

Fixes #18348.


# 799ab823 18-Sep-2022 Jérôme Duval <jerome.duval@gmail.com>

libroot: Add support for C11 Threads missing parts (except gcc2).

The respective files can be found in the FreeBSD source tree at:
- lib/libstdthreads/call_once.c
- lib/libstdthreads/cnd.c
- lib/libstdthreads/mtx.c
- lib/libstdthreads/threads.h
- lib/libstdthreads/tss.c

Missing is support for PTHREAD_DESTRUCTOR_ITERATIONS.

Change-Id: I7a6c79954f36195eadd1351d308c21a001192232
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5675
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>


# bdd35de7 18-Apr-2022 Dominic Martinez <dom@dominicm.dev>

libroot: Add support for C11 threads (except gcc2).

Some programs use C11 threads instead of POSIX threads, so this change
implements a light wrapper around POSIX threads that conforms to the
C11 spec.

This code was primarily taken from FreeBSD, with minor modifications:
- The header file was trimmed to only include functions in the C11
spec, and changed to match the format of other Haiku header files
- The thrd_yield function was implemented with its POSIX equivalent
sched_yield instead of the non-standard pthread_yield
- The thrd_create function was changed to return thrd_busy on an
EAGAIN error code instead of unconditionally returning thrd_error

The respective files can be found in the FreeBSD source tree at:
- lib/libstdthreads/threads.h
- lib/libstdthreads/thrd.c

TODO:
- untested (is a unit test in order?)

Change-Id: I422f96f4854cd686f9637fc2e98cb03ce06a764a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5213
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>