Skip to content

Commit

Permalink
libc/semaphore:sem_init change defult protocol
Browse files Browse the repository at this point in the history
Signed-off-by: anjiahao <[email protected]>
  • Loading branch information
anjiahao1 committed Dec 24, 2021
1 parent 509350a commit 38a2be0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions drivers/input/tsc2007.c
Original file line number Diff line number Diff line change
Expand Up @@ -1228,6 +1228,7 @@ int tsc2007_register(FAR struct i2c_master_s *dev,
priv->config = config; /* Save the board configuration */

nxsem_init(&priv->devsem, 0, 1); /* Initialize device structure semaphore */
nxsem_set_protocol(&priv->devsem, SEM_PRIO_INHERIT);
nxsem_init(&priv->waitsem, 0, 0); /* Initialize pen event wait semaphore */

/* The event wait semaphore is used for signaling and, hence, should not
Expand Down
2 changes: 1 addition & 1 deletion libs/libc/semaphore/sem_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ int nxsem_init(FAR sem_t *sem, int pshared, unsigned int value)
/* Initialize to support priority inheritance */

#ifdef CONFIG_PRIORITY_INHERITANCE
sem->flags = 0;
sem->flags |= PRIOINHERIT_FLAGS_DISABLE;
# if CONFIG_SEM_PREALLOCHOLDERS > 0
sem->hhead = NULL;
# else
Expand Down

0 comments on commit 38a2be0

Please sign in to comment.