pthread.h
一 线程是什么
线程从属于进程,进程分配资源,线程执行任务。
二 pthread.h
类型
pthread_t radioThreadp;
pthread_condattr_t radioThread_attr;
pthread_cond_t radioThread_cond;
pthread_mutex_t radioThread_mutex;
方法
int pthread_create(pthread_t *id, const pthread_attr_t *attr, void *(*)(void *), void *arg);
功能:创建一个线程来运行一个函数。线程创建成功会将j该线程的ID存储到变量id中,并返回0,否则返回非0。
pthread_mutex_init()
pthread_mutex_lock()
pthread_mutex_unlock()
pthread_condattr_init()
pthread_condattr_setclock()
pthread_cond_init()