sortix-mirror/libc/pthread
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
..
pthread_attr_destroy.c Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
pthread_attr_getdetachstate.c Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
pthread_attr_getstacksize.c Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
pthread_attr_init.c Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
pthread_attr_setdetachstate.c Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
pthread_attr_setstacksize.c Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
pthread_cond_broadcast.c Implement threading primitives that truly sleep. 2021-06-23 22:10:47 +02:00
pthread_cond_destroy.c Implement threading primitives that truly sleep. 2021-06-23 22:10:47 +02:00
pthread_cond_init.c Implement threading primitives that truly sleep. 2021-06-23 22:10:47 +02:00
pthread_cond_signal.c Implement threading primitives that truly sleep. 2021-06-23 22:10:47 +02:00
pthread_cond_timedwait.c Implement threading primitives that truly sleep. 2021-06-23 22:10:47 +02:00
pthread_cond_wait.c Implement threading primitives that truly sleep. 2021-06-23 22:10:47 +02:00
pthread_condattr_destroy.c Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
pthread_condattr_getclock.c Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
pthread_condattr_init.c Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
pthread_condattr_setclock.c Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
pthread_create.c Fix pthread stack alignment. 2016-05-15 19:30:51 +02:00
pthread_detach.c Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
pthread_equal.c Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
pthread_exit.c Implement threading primitives that truly sleep. 2021-06-23 22:10:47 +02:00
pthread_getspecific.c Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
pthread_join.c Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
pthread_key_create.c Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
pthread_key_delete.c Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
pthread_keys.c Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
pthread_mutex_destroy.c Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
pthread_mutex_init.c Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
pthread_mutex_lock.c Implement threading primitives that truly sleep. 2021-06-23 22:10:47 +02:00
pthread_mutex_trylock.c Implement threading primitives that truly sleep. 2021-06-23 22:10:47 +02:00
pthread_mutex_unlock.c Fix deadlocks and lost wakeups in threading primitives. 2022-12-10 21:29:23 +01:00
pthread_mutexattr_destroy.c Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
pthread_mutexattr_gettype.c Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
pthread_mutexattr_init.c Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
pthread_mutexattr_settype.c Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
pthread_once.c Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
pthread_rwlock_destroy.c Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
pthread_rwlock_init.c Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
pthread_rwlock_rdlock.c Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
pthread_rwlock_tryrdlock.c Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
pthread_rwlock_trywrlock.c Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
pthread_rwlock_unlock.c Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
pthread_rwlock_wrlock.c Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
pthread_rwlockattr_destroy.c Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
pthread_rwlockattr_init.c Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
pthread_self.c Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
pthread_setspecific.c Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00