xiaoxiang781216 commented on code in PR #16944: URL: https://github.com/apache/nuttx/pull/16944#discussion_r2314772481
########## sched/semaphore/semaphore.h: ########## @@ -71,6 +71,12 @@ void nxsem_timeout(wdparm_t arg); void nxsem_recover(FAR struct tcb_s *tcb); +#ifdef CONFIG_CUSTOM_SEMAPHORE_MAXVALUE +/* Set sem max allowed value */ + +int sem_setmaxvalue(FAR sem_t *sem, int32_t maxvalue); Review Comment: nuttx special function need start with nxsem_ ########## include/semaphore.h: ########## @@ -134,6 +134,9 @@ struct sem_s uint8_t ceiling; /* The priority ceiling owned by mutex */ uint8_t saved; /* The saved priority of thread before boost */ Review Comment: move before line 124 for alignment ########## sched/semaphore/sem_post.c: ########## @@ -125,7 +125,11 @@ int nxsem_post_slow(FAR sem_t *sem) sem_count = atomic_read(NXSEM_COUNT(sem)); do { +#ifdef CONFIG_CUSTOM_SEMAPHORE_MAXVALUE + if (sem_count >= sem->maxvalue) +#else if (sem_count >= SEM_VALUE_MAX) Review Comment: could we change SEM_VALUE_MAX to CONFIG_SEM_VALUE_MAX to implement the similar change? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org