Linux多線程之線程同步(條件變量)

什麼是線程同步? 案例原型:A先掃5次地,A掃完地B再拖地,從而完成線程同步。 #include <stdio.h> #include <pthread.h> pthread_t thread[2]; int number = 0;//共享資源 pthread_mutex_t mut; void studentA() { int i; for(i=0;i<5;i++) { pt
相關文章
相關標籤/搜索