zhangmeng
2024-01-18 8fc23a3bb9f49e88478a2505fa7dee434ec50c16
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
#ifndef _SEM_UTIL_H
#define _SEM_UTIL_H  
 
#include "usg_common.h"
#include "usg_typedef.h"
 
namespace SemUtil {
 
    int get(key_t key, unsigned int value);
    int dec(int semId);
    int dec_nowait(int semId);
    int dec_timeout(int semId, struct timespec * timeout);
    int dec_uni(int semId);
    int zero(int semId);
    int zero_nowait(int semId);
    int zero_timeout(int semId, struct timespec * timeout);
    int inc(int semId);
    int set(int semId, int val);
 
    void remove(int semid);
 
}
 
#define SEM_USG_WT_TIMEOUT  60
 
#endif