sortix-mirror/libc
Jonas 'Sortie' Termansen 3154492dcf Fix deadlocks and lost wakeups in threading primitives.
The futex and kutex implementations used the same linked list for waiting,
however the futex implementation used kutexs and the same thread could be in
the same list twice in the case of contention. This case corrupted the wait
lists and led to deadlocks and lost wakeups. This change fixes the problem
by having separate data structures for futexes and kutexes.

Mutexes contended by multiple threads could lead to lost wakeups since only
one contended thread was awoken and subsequent unlocks are unaware of the
unawakened contended threads. This change fixes the problem with a temporary
solution of waking all the contended threads until a better design is
implemented.

Additional details are tweaked to be more reliable and simpler.
2022-12-10 21:29:23 +01:00
..
arpa/inet Fix inet_pton(3) parsing 1:: and ::1.2.3.4 cases. 2020-08-01 14:23:44 +02:00
assert Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
blf Convert libc to C. 2016-03-03 23:02:23 +01:00
c++ Compile libc with -ffreestanding. 2016-05-15 22:43:29 +02:00
ctype Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
dirent Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
dlfcn Make the branding system more neutral. 2016-05-15 22:43:29 +02:00
err Add errc(3) family. 2016-11-06 15:31:52 -06:00
errno Clean up errno. 2016-05-15 22:43:29 +02:00
error Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
fcntl Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
fnmatch Fix shift out of bounds in fnmatch(3). 2016-05-15 19:30:51 +02:00
fsmarshall Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
fstab Fix getline(3) and getdelim(3) usage. 2016-05-15 19:32:04 +02:00
getopt Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
grp Remove ENOUSER and ENOGROUP. 2021-05-10 23:26:31 +02:00
include Add EHOSTDOWN. 2022-12-04 23:18:17 +01:00
init Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
inttypes Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
ioleast Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
langinfo Add nl_langinfo(3). 2016-10-03 20:02:12 +02:00
libgen Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
locale Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
malloc Fix double declaration of __heap_mutex. 2016-10-17 18:38:04 +02:00
msr Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
netdb Add getnameinfo(3). 2017-02-14 20:43:30 +01:00
netinet/in Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
poll Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
psctl Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
pthread Fix deadlocks and lost wakeups in threading primitives. 2022-12-10 21:29:23 +01:00
pty Add openpty(3). 2016-11-23 22:31:05 +01:00
pwd Remove ENOUSER and ENOGROUP. 2021-05-10 23:26:31 +02:00
regex Add REG_STARTEND. 2016-10-30 18:08:59 +01:00
sched Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
scram Document scram(2). 2017-02-12 13:59:07 +01:00
semaphore Implement threading primitives that truly sleep. 2021-06-23 22:10:47 +02:00
sha2 Add <sha2.h>. 2020-04-13 22:15:04 +02:00
signal Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
ssp Add __stack_chk_fail_local needed by some architectures. 2021-12-12 22:13:05 +01:00
stdio Fix printf(3) handling of negative precision. 2021-02-13 22:33:03 +01:00
stdio_ext Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
stdlib Change qsort(3) and qsort_r(3) to use heapsort. 2021-12-12 15:18:26 +00:00
string Add EHOSTDOWN. 2022-12-04 23:18:17 +01:00
sys Document getdnsconfig(2) and setdnsconfig(2). 2022-03-06 16:18:12 +02:00
syslog Implement RFC5424 syslog version 1. 2022-01-05 22:00:53 +01:00
termios Add pseudo terminals. 2016-11-23 22:31:05 +01:00
time Fix strftime(3) error handling and add %F, %z, and %Z support. 2021-04-06 23:22:22 +02:00
timespec Fix handling of overflow and non-canonical values in timespec APIs. 2021-06-22 21:48:27 +02:00
ubsan Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
unistd Fix usleep(2) sleeping 1000x too much regression. 2021-06-23 22:09:57 +02:00
utime Fix utime(3) not handling times being NULL. 2022-09-18 23:21:04 +02:00
wchar Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
wctype Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
x64 Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
x86 Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
.gitignore Add <sha2.h>. 2020-04-13 22:15:04 +02:00
Makefile Fix non-throwing operator new failure checks being optimized away. 2022-04-26 01:08:19 +02:00