#include <pthread.h>
//线程
int pthread_create(pthread_t *tid, const pthread_attr_t *attr, void *(*func)(void*), void *arg);
int pthread_join(pthread_t *tid, void **status);
pthread_t pthread_self(void);
int pthread_detach(pthread_t tid);
void pthread_exit(void *status);
//线程特定数据
int pthread_once(pthread_once_t *onceptr/*PTHREAD_ONCE_INIT*/, void (*init)(void));
int pthread_key_create(pthread_key_t *keyptr, void (*destructor)(void *value));
void *pthread_getspecific(pthread_key_t key);
int pthread_setspecific(pthread_key_t key, const void *value);
//互斥锁
int pthread_mutex_lock(pthread_mutex_t *mptr);
int pthread_mutex_unlock(pthread_mutex_t *mptr);
//条件变量
int pthread_cond_wait(pthread_cond_t *cptr, pthread_mutex_t *mptr);
int pthread_cond_signal(pthread_cond_t *cptr);
int pthread_cond_broadcast(pthread_cond_t *cptr);
int pthread_cond_timedwait(pthread_cond_t *cptr, pthread_mutex_t *mptr, const struct timespec *abstime);//gettimeofday clock_gettime