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
相关文章
相关标签/搜索