LibC: Implement pthread_barrier
This is yet another bad sched_yield implementation :D
This commit is contained in:
@@ -31,8 +31,9 @@ typedef struct { pthread_mutexattr_t attr; pthread_t locker; unsigned lock_depth
|
||||
typedef int pthread_barrierattr_t;
|
||||
typedef int pthread_barrier_t;
|
||||
|
||||
typedef int pthread_condattr_t;
|
||||
typedef int pthread_cond_t;
|
||||
typedef struct { int clock; int shared; } pthread_condattr_t;
|
||||
struct _pthread_cond_block { struct _pthread_cond_block* next; int signaled; };
|
||||
typedef struct { pthread_condattr_t attr; pthread_spinlock_t lock; struct _pthread_cond_block* block_list; } pthread_cond_t;
|
||||
|
||||
typedef struct { int shared; } pthread_rwlockattr_t;
|
||||
typedef struct { pthread_rwlockattr_t attr; unsigned lockers; unsigned writers; } pthread_rwlock_t;
|
||||
|
||||
@@ -54,7 +54,7 @@ struct uthread
|
||||
#define PTHREAD_MUTEX_RECURSIVE 3
|
||||
|
||||
#define PTHREAD_SPIN_INITIALIZER (pthread_spinlock_t)0
|
||||
#define PTHREAD_COND_INITIALIZER (pthread_cond_t)0
|
||||
#define PTHREAD_COND_INITIALIZER (pthread_cond_t){ { CLOCK_REALTIME, 0 }, PTHREAD_SPIN_INITIALIZER, NULL }
|
||||
#define PTHREAD_MUTEX_INITIALIZER (pthread_mutex_t){ { PTHREAD_MUTEX_DEFAULT, false }, 0, 0 }
|
||||
#define PTHREAD_RWLOCK_INITIALIZER (pthread_rwlock_t){ { false }, 0, 0 }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user