fujuntang
2021-09-07 b984dac55bdd0a5b694837fb8fb2ceb07ce9808f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#ifndef _SVSEM_UTIL_H
#define _SVSEM_UTIL_H  
 
#include "usg_common.h"
 
int svsem_get(key_t key, unsigned int value) ;
/* Reserve semaphore (blocking), return 0 on success, or -1 with 'errno'
   set to EINTR if operation was interrupted by a signal handler */
 
/* Reserve semaphore - decrement it by 1 */
int svsem_wait(int semid)  ;
 
int svsem_trywait(int semid)  ;
 
int svsem_timedwait(const int semid, const struct timespec *timeout) ;
 
/* Release semaphore - increment it by 1 */
int svsem_post(int semid) ;
 
 
 
int svsem_cond_wait(int semid ) ;
int svsem_cond_signal(int semid ) ;
 
/**
 * If sem_op equals 0, the value of the semaphore is checked to see whether it
 * currently equals 0. If it does, the operation completes immediately; otherwise,
 * semop() blocks until the semaphore value becomes 0.
 */
int svsem_zero(int semid) ; 
 
 
int svsem_zero_nowait(int semid) ;
 
int svsem_zero_timeout(const int semid, const struct timespec *timeout)  ;
 
 
 
 
 
int svsem_set(int semid, int val) ;
 
 
 
 
void svsem_remove(int semid) ;
#endif