<pthread.h>
pthread_equal
pthread_self(void)
pthread_create()
pthread_close()
pthread_join()
phread_cancel()
pthread_cleanup_push()
pthread_cleanup_pop()
同步:
1互斥量
pthread_mutex_init()
pthread_mutex_destory()
pthread_mutex_lock()
pthread_mutex_trylock()
pthread_mutex_unlock()
2读写锁:3种状态,读状态锁(可多个),写(同时只一个),不加锁
pthread_rwlock_init()
pthread_rwlock_destroy()
pthread_rwlock_rdlock()
pthread_rwlock_wrlock()
pthread_rwlock_tryrdlock()
pthread_rwlock_trywrlock()
pthread_rwlock_unlock()
3 条件变量
本身由互斥量保护
pthread_cond_init()
pthread_cond_destory()
pthread_cond_wait()
pthfead_cond_timewait()
pthread_cond_signal()
pthread_cond_broadcast()