1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 15:47:34 +00:00

Kernel: Some futex improvements

This adds support for FUTEX_WAKE_OP, FUTEX_WAIT_BITSET, FUTEX_WAKE_BITSET,
FUTEX_REQUEUE, and FUTEX_CMP_REQUEUE, as well well as global and private
futex and absolute/relative timeouts against the appropriate clock. This
also changes the implementation so that kernel resources are only used when
a thread is blocked on a futex.

Global futexes are implemented as offsets in VMObjects, so that different
processes can share a futex against the same VMObject despite potentially
being mapped at different virtual addresses.
This commit is contained in:
Tom 2020-12-21 23:21:58 -07:00 committed by Andreas Kling
parent 7581b64705
commit 1d621ab172
23 changed files with 928 additions and 63 deletions

View file

@ -78,7 +78,7 @@ struct utimbuf {
typedef int pthread_t;
typedef int pthread_key_t;
typedef int32_t pthread_once_t;
typedef uint32_t pthread_once_t;
typedef struct __pthread_mutex_t {
uint32_t lock;
@ -93,7 +93,7 @@ typedef struct __pthread_mutexattr_t {
} pthread_mutexattr_t;
typedef struct __pthread_cond_t {
int32_t value;
uint32_t value;
uint32_t previous;
int clockid; // clockid_t
} pthread_cond_t;