Skip to content

Commit 8cfb9d7

Browse files
wangchdoanchao
authored andcommitted
libs/libc/semaphore: allow nxsem_init to negative value
Allow user to init semaphore value to negative value, this is needed in some use cases
1 parent 0ded247 commit 8cfb9d7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

include/nuttx/semaphore.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ extern "C"
147147
*
148148
****************************************************************************/
149149

150-
int nxsem_init(FAR sem_t *sem, int pshared, uint32_t value);
150+
int nxsem_init(FAR sem_t *sem, int pshared, int32_t value);
151151

152152
/****************************************************************************
153153
* Name: nxsem_destroy

libs/libc/semaphore/sem_init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
*
6363
****************************************************************************/
6464

65-
int nxsem_init(FAR sem_t *sem, int pshared, uint32_t value)
65+
int nxsem_init(FAR sem_t *sem, int pshared, int32_t value)
6666
{
6767
UNUSED(pshared);
6868

0 commit comments

Comments
 (0)