WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
osal_semaphore.h
浏览该文件的文档.
1/*
2 * Copyright (c) HiSilicon (Shanghai) Technologies Co., Ltd. 2021-2022. All rights reserved.
3 * Description: OS Abstract Layer.
4 */
5
9#ifndef __OSAL_SEMAPHORE_H__
10#define __OSAL_SEMAPHORE_H__
11
12#ifdef __cplusplus
13#if __cplusplus
14extern "C" {
15#endif
16#endif
17
18#define OSAL_SEM_WAIT_FOREVER (-1)
19
20typedef struct {
21 void *sem;
23
40int osal_sem_init(osal_semaphore *sem, int val);
41
59
83
105int osal_sem_down_timeout(osal_semaphore *sem, unsigned int timeout);
106
125
148
165void osal_sem_up(osal_semaphore *sem);
166
183
184#ifdef __cplusplus
185#if __cplusplus
186}
187#endif
188#endif
189#endif /* __OSAL_SEMAPHORE_H__ */
int osal_sem_down_timeout(osal_semaphore *sem, unsigned int timeout)
Acquire the semaphore within a specified time that specifies the timeout period.
Definition osal_semaphore.c:73
int osal_sem_down(osal_semaphore *sem)
Request a semaphore.
Definition osal_semaphore.c:55
void osal_sem_up(osal_semaphore *sem)
Release a semaphore.
Definition osal_semaphore.c:128
int osal_sem_binary_sem_init(osal_semaphore *sem, int val)
Create a binary semaphore.
Definition osal_semaphore.c:29
int osal_sem_init(osal_semaphore *sem, int val)
Create a semaphore.
Definition osal_semaphore.c:15
int osal_sem_trydown(osal_semaphore *sem)
try to acquire the semaphore, without waiting.
Definition osal_semaphore.c:109
void osal_sem_destroy(osal_semaphore *sem)
Delete a semaphore.
Definition osal_semaphore.c:43
int osal_sem_down_interruptible(osal_semaphore *sem)
acquire the semaphore unless interrupted.
Definition osal_semaphore.c:93
Definition osal_semaphore.h:20
void * sem
Definition osal_semaphore.h:21