#include <pthread.h>
// pthread
int pthread_equal(pthread_t tid1, pthread_t tid2);
pthread_t pthread_self();
int pthread_create(pthread_t* tid, const pthread_attr_t* attr, void* (*start)(void*), void* arg);
void pthread_exit(void *rval);
int pthread_join(pthread_t tid, void** rval);
int pthread_cancel(pthread_t tid);
void pthread_cleanup_push(void(*rtn)(void*), void* arg);
void pthread_cleanup_pop(int execute);
int pthread_detach(pthread_t tid);
// mutex
int pthread_mutex_init(pthread_mutex_t* mtx, const pthread_mutexattr_t* attr);
int pthread_mutex_destroy(pthread_mutex_t* mtx);
int pthread_mutex_lock(pthread_mutex_t* mtx);
int pthread_mutex_timedlock(pthread_mutex_t* mtx, const struct timespec* time);
int pthread_mutex_trylock(pthread_mutex_t* mtx);
int pthread_mutex_unlock(pthread_mutex_t* mtx);
// read-write lock
int pthread_rwlock_init(pthread_rwlock_t* lock, const pthread_rwlockattr_t* attr);
int pthread_rwlock_destroy(pthread_rwlock_t* lock);
int pthread_rwlock_rdlock(pthread_rwlock_t* lock);
int pthread_rwlock_wrlock(pthread_rwlock_t* lock);
int pthread_rwlock_timedrdlock(pthread_rwlock_t* lock, const struct timespec* time);
int pthread_rwlock_timedwrlock(pthread_rwlock_t* lock, const struct timespec* time);
int pthread_rwlock_tryrdlock(pthread_rwlock_t* lock);
int pthread_rwlock_trywrlock(pthread_rwlock_t* lock);
int pthread_rwlock_unlock(pthread_rwlock_t* lock);
// condition
int pthread_cond_init(pthread_cond_t* cond, const pthread_condattr_t* attr);
int pthread_cond_destroy(pthread_cond_t* cond);
int pthread_cond_wait(pthread_cond_t* cond, pthread_mutex_t* mtx);
int pthread_cond_timedwait(pthread_cond_t* cond, pthread_mutex_t* mtx, const struct timespec* time);
int pthread_cond_signal(pthread_cond_t* cond);
int pthread_cond_broadcast(pthread_cond_t* cond);
// spin
int pthread_spin_init(pthread_spinlock_t* lock, int pshared);
int pthread_spin_destroy(pthread_spinlock_t* lock);
int pthread_spin_lock(pthread_spinlock_t* lock);
int pthread_spin_trylock(pthread_spinlock_t* lock);
int pthread_spin_unlock(pthread_spinlock_t* lock);
// barrier
int pthread_barrier_init(pthread_barrier_t* barrier, const pthread_barrierattr_t* attr, unsigned int count);
int pthread_barrier_destroy(pthread_barrier_t* barrier);
int pthread_barrier_wait(pthread_barrier_t* barrier);
c11_api