LibC: Implement pthread_rwlock
This uses the same dumb sched_yield instead of actually blocking :D
This commit is contained in:
@@ -34,8 +34,8 @@ typedef int pthread_barrier_t;
|
||||
typedef int pthread_condattr_t;
|
||||
typedef int pthread_cond_t;
|
||||
|
||||
typedef int pthread_rwlockattr_t;
|
||||
typedef int pthread_rwlock_t;
|
||||
typedef struct { int shared; } pthread_rwlockattr_t;
|
||||
typedef struct { pthread_rwlockattr_t attr; unsigned lockers; unsigned writers; } pthread_rwlock_t;
|
||||
|
||||
#endif
|
||||
#undef __need_pthread_types
|
||||
|
||||
@@ -55,7 +55,7 @@ struct uthread
|
||||
|
||||
#define PTHREAD_COND_INITIALIZER (pthread_cond_t)0
|
||||
#define PTHREAD_MUTEX_INITIALIZER (pthread_mutex_t){ { PTHREAD_MUTEX_DEFAULT, false }, 0, 0 }
|
||||
#define PTHREAD_RWLOCK_INITIALIZER (pthread_rwlock_t)0
|
||||
#define PTHREAD_RWLOCK_INITIALIZER (pthread_rwlock_t){ { false }, 0, 0 }
|
||||
|
||||
int pthread_atfork(void (*prepare)(void), void (*parent)(void), void(*child)(void));
|
||||
int pthread_attr_destroy(pthread_attr_t* attr);
|
||||
|
||||
Reference in New Issue
Block a user