@ -314,6 +314,8 @@ defconfig -- This is a configuration file similar to the Linux
@@ -314,6 +314,8 @@ defconfig -- This is a configuration file similar to the Linux
/* Verify that a semaphore was provided and the count is within the valid
*range.
*/
if(sem&&value<=SEM_VALUE_MAX)
{
/* Initialize the seamphore count */
sem->semcount=(int16_t)value;
/* Initialize to support priority inheritance */
#ifdef CONFIG_PRIORITY_INHERITANCE
#if CONFIG_SEM_PREALLOCHOLDERS > 0
#if CONFIG_SEM_PREALLOCHOLDERS > 0
sem->hlist.flink=NULL;
#endif
#endif
sem->hlist.holder=NULL;
sem->hlist.counts=0;
#endif
@ -110,6 +119,6 @@ int sem_init (FAR sem_t *sem, int pshared, unsigned int value)
@@ -110,6 +119,6 @@ int sem_init (FAR sem_t *sem, int pshared, unsigned int value)