Linux多線程(十一)信號量實現條件變量

這份代碼也是基於上兩篇博文修改,利用信號量實現了條件變量: 源碼1: #include <pthread.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <semaphore.h> typedef struct {    int res;    sem_t sem; }Result; void * fun
相關文章
相關標籤/搜索