mirror of
https://gitee.com/acl-dev/acl.git
synced 2024-12-04 12:59:39 +08:00
cc05b877a2
first commit acl to github
34 lines
729 B
C
34 lines
729 B
C
|
|
#ifndef __ACL_SEM_INCLUDE_H__
|
|
#define __ACL_SEM_INCLUDE_H__
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
#include "stdlib/acl_define.h"
|
|
|
|
#ifdef ACL_MS_WINDOWS
|
|
|
|
typedef struct ACL_SEM ACL_SEM;
|
|
struct ACL_SEM {
|
|
HANDLE id;
|
|
unsigned int volatile count;
|
|
};
|
|
|
|
ACL_API ACL_SEM *acl_sem_create2(const char *pathname, unsigned int initial_value);
|
|
ACL_API ACL_SEM *acl_sem_create(unsigned int initial_value);
|
|
ACL_API void acl_sem_destroy(ACL_SEM *sem);
|
|
ACL_API int acl_sem_wait_timeout(ACL_SEM *sem, unsigned int timeout);
|
|
ACL_API int acl_sem_try_wait(ACL_SEM *sem);
|
|
ACL_API int acl_sem_wait(ACL_SEM *sem);
|
|
ACL_API unsigned int acl_sem_value(ACL_SEM *sem);
|
|
ACL_API int acl_sem_post(ACL_SEM *sem);
|
|
|
|
#endif
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif
|