bdd35de712
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> |
||
---|---|---|
.. | ||
arch | ||
arpa | ||
compat/sys | ||
net | ||
netinet | ||
netinet6 | ||
sys | ||
alloca.h | ||
assert.h | ||
bsd_mem.h | ||
complex.h | ||
ctype.h | ||
dirent.h | ||
div_t.h | ||
dlfcn.h | ||
endian.h | ||
errno.h | ||
fcntl.h | ||
fenv.h | ||
fnmatch.h | ||
fts.h | ||
ftw.h | ||
getopt.h | ||
glob.h | ||
grp.h | ||
inttypes.h | ||
iovec.h | ||
langinfo.h | ||
libgen.h | ||
libio.h | ||
limits.h | ||
locale.h | ||
malloc_debug.h | ||
malloc.h | ||
math.h | ||
memory.h | ||
monetary.h | ||
netdb.h | ||
nl_types.h | ||
null.h | ||
poll.h | ||
pthread.h | ||
pwd.h | ||
regex.h | ||
resolv.h | ||
sched.h | ||
search.h | ||
semaphore.h | ||
setjmp.h | ||
shadow.h | ||
signal.h | ||
size_t.h | ||
spawn.h | ||
stdint.h | ||
stdio_ext.h | ||
stdio_post.h | ||
stdio_pre.h | ||
stdio.h | ||
stdlib.h | ||
string.h | ||
strings.h | ||
syslog.h | ||
tar.h | ||
termios.h | ||
threads.h | ||
time.h | ||
uchar.h | ||
unistd.h | ||
utime.h | ||
utmpx.h | ||
wchar_t.h | ||
wchar.h | ||
wctype.h |