diff --git a/libgcc/gthr-posix.h b/libgcc/gthr-posix.h index f1a5ab8e075c4..90fe01d16b40f 100644 --- a/libgcc/gthr-posix.h +++ b/libgcc/gthr-posix.h @@ -44,6 +44,63 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see # endif #endif +#define PTHREAD_MUTEX_INITIALIZER (-1) +#define PTHREAD_MUTEX_NORMAL 0 +#define PTHREAD_MUTEX_RECURSIVE 1 +#define PTHREAD_MUTEX_ERRORCHECK 2 +#define PTHREAD_MUTEX_DEFAULT PTHREAD_MUTEX_NORMAL + +#define PTHREAD_COND_INITIALIZER (-1) + +#define PTHREAD_ONCE_INIT {1,0} + +/* https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_cancel.html */ +int pthread_cancel(pthread_t thread); +/* https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_cond_broadcast.html */ +int pthread_cond_broadcast(pthread_cond_t *cond); +/* https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_cond_destroy.html */ +int pthread_cond_destroy(pthread_cond_t *cond); +int pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *__restrict attr); +/* https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_cond_broadcast.html */ +int pthread_cond_signal(pthread_cond_t *cond); +/* https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_cond_timedwait.html */ +int pthread_cond_timedwait(pthread_cond_t *__restrict cond, pthread_mutex_t *__restrict mutex, const struct timespec *__restrict abstime); +int pthread_cond_wait(pthread_cond_t *__restrict cond, pthread_mutex_t *__restrict mutex); +/* https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_create.html */ +int pthread_create(pthread_t *__restrict thread, const pthread_attr_t *__restrict attr, void *(*start_routine)(void*), void *__restrict arg); +/* https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_detach.html */ +int pthread_detach(pthread_t thread); +/* https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_equal.html */ +int pthread_equal(pthread_t t1, pthread_t t2); +/* https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_getspecific.html */ +void *pthread_getspecific(pthread_key_t key); +/* https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_join.html */ +int pthread_join(pthread_t thread, void **value_ptr); +/* https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_key_create.html */ +int pthread_key_create(pthread_key_t *key, void (*destructor)(void*)); +/* https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_key_delete.html */ +int pthread_key_delete(pthread_key_t key); +/* https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_mutexattr_destroy.html */ +int pthread_mutexattr_destroy(pthread_mutexattr_t *attr); +int pthread_mutexattr_init(pthread_mutexattr_t *attr); +/* https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_mutexattr_gettype.html */ +int pthread_mutexattr_settype(pthread_mutexattr_t *attr, int type); +/* https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_mutex_destroy.html */ +int pthread_mutex_destroy(pthread_mutex_t *mutex); +int pthread_mutex_init(pthread_mutex_t *__restrict mutex, const pthread_mutexattr_t *__restrict attr); +/* https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_mutex_lock.html */ +int pthread_mutex_lock(pthread_mutex_t *mutex); +int pthread_mutex_trylock(pthread_mutex_t *mutex); +int pthread_mutex_unlock(pthread_mutex_t *mutex); +/* https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_once.html */ +int pthread_once(pthread_once_t *once_control, void (*init_routine)(void)); +/* https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/pthread.h.html */ +pthread_t pthread_self(void); +/* https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_getspecific.html */ +int pthread_setspecific(pthread_key_t key, const void *value); +/* https://pubs.opengroup.org/onlinepubs/9699919799/functions/sched_yield.html */ +int sched_yield(void); + typedef pthread_t __gthread_t; typedef pthread_key_t __gthread_key_t; typedef pthread_once_t __gthread_once_t;