acl  3.5.3.0
acl_sem.h
浏览该文件的文档.
1 #ifndef ACL_SEM_INCLUDE_H
2 #define ACL_SEM_INCLUDE_H
3 
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
7 #include "../stdlib/acl_define.h"
8 
9 #if defined(_WIN32) || defined(_WIN64)
10 
11 typedef struct ACL_SEM ACL_SEM;
12 struct ACL_SEM {
13  HANDLE id;
14  unsigned int volatile count;
15 };
16 
17 ACL_API ACL_SEM *acl_sem_create2(const char *pathname,
18  unsigned int initial_value);
19 ACL_API ACL_SEM *acl_sem_create(unsigned int initial_value);
20 ACL_API void acl_sem_destroy(ACL_SEM *sem);
21 ACL_API int acl_sem_wait_timeout(ACL_SEM *sem, unsigned int timeout);
22 ACL_API int acl_sem_try_wait(ACL_SEM *sem);
23 ACL_API int acl_sem_wait(ACL_SEM *sem);
24 ACL_API unsigned int acl_sem_value(ACL_SEM *sem);
25 ACL_API int acl_sem_post(ACL_SEM *sem);
26 
27 #endif
28 
29 #ifdef __cplusplus
30 }
31 #endif
32 
33 #endif