LibC: Implement blocking pthread_rwlock

pthread_rwlock now uses a mutex and condition variable internally so it
doesn't need to yield while waiting!
This commit is contained in:
2026-04-05 12:06:38 +03:00
parent ec4aa8d0b6
commit 34b59f062b
2 changed files with 68 additions and 70 deletions

View File

@@ -67,9 +67,11 @@ typedef struct
} pthread_rwlockattr_t;
typedef struct
{
pthread_rwlockattr_t attr;
unsigned lockers;
unsigned writers;
pthread_mutex_t lock;
pthread_cond_t cond;
unsigned writers_waiting;
unsigned writer_active;
unsigned readers_active;
} pthread_rwlock_t;
__END_DECLS