00001
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _CF_SEMAPHORE_H
00021 #define _CF_SEMAPHORE_H
00022
00023 #ifdef _SEM_SEMUN_UNDEFINED
00024 union semun {
00025 int val;
00026 struct semid_ds *buf;
00027 unsigned short int *array;
00028 struct seminfo *__buf;
00029 };
00030 #endif
00031
00035 #define CF_SEM_LOCK(id,sem) (cf_sem_pv(id,-1,sem))
00036
00040 #define CF_SEM_DOWN(id,sem) (cf_sem_pv(id,-1,sem))
00041
00045 #define CF_SEM_UNLOCK(id,sem) (cf_sem_pv(id,1,sem))
00046
00050 #define CF_SEM_UP(id,sem) (cf_sem_pv(id,1,sem))
00051
00055 #define CF_SEM_WAITZERO(id,sem) (cf_sem_pv(id,0,sem))
00056
00064 int cf_sem_pv(int id,int operation,int semnum);
00065
00074 int cf_sem_getval(int id,int semnum,int num,unsigned short *val);
00075
00076 #endif
00077
00078