UINT32 LOS_BinarySemCreate ( UINT16  usCount,
UINT32 puwSemHandle  
)

Create a binary semaphore.

Description:
This API is used to create a binary semaphore control structure according to the initial number of available semaphores specified by usCount and return the ID of this semaphore control structure.
注意:
  • None.
参数:
参数名称 描述
usCount  [IN] Initial number of available semaphores. The value range is [0, 1].
puwSemHandle  [OUT] ID of the semaphore control structure that is initialized.
返回值:
返回值 描述
LOS_ERRNO_SEM_PTR_NULL  The passed-in puwSemHandle value is NULL.
LOS_ERRNO_SEM_OVERFLOW  The passed-in usCount value is greater than the maximum number of available semaphores.
LOS_ERRNO_SEM_ALL_BUSY  No semaphore control structure is available.
LOS_OK  The semaphore is successfully created.
Dependency:
  • los_sem.h: the header file that contains the API declaration.
参见:
LOS_SemDelete
自从:
Huawei LiteOS V100R001C00