摘要:
#include #include #include //互斥变量和条件变量静态初始化pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;/*初始化互斥锁*/pthread_cond_t cond = PTHREAD_COND_INITIALIZER;/*初始化条件变量*/void *thread1(void *);void *thread2(void *);int i=1;int main(void){ // sleep(30); pthread_t t_a; pthread_t t_b; pthread_create(&... 阅读全文