linux互斥操作——信号量
摘要:
简单的互斥操作:#include<stdio.h>#include<unistd.h>#include<stdlib.h>#include<stdlib.h>#include<sys/types.h>#include <sys/ipc.h>#include<sys/sem.h>int p(int sem_id){ struct sembuf sb; sb.sem_num=0; sb.sem_op=-1; sb.sem_flg=SEM_UNDO; if(semop(sem_id,&sb,1)==-1) r 阅读全文
posted @ 2012-04-18 22:48 wps712 阅读(258) 评论(0) 推荐(0) 编辑