You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2024/10/31 10:37:58 UTC

(nuttx) branch master updated: nuttx/semaphore: Move define CONFIG_SEM_PREALLOCHOLDERS to include/semaphore.h.

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new d1e5b38b9b nuttx/semaphore: Move define CONFIG_SEM_PREALLOCHOLDERS to include/semaphore.h.
d1e5b38b9b is described below

commit d1e5b38b9bc74ec8300f58c567279201a22d1bae
Author: cuiziwei <cu...@xiaomi.com>
AuthorDate: Tue Aug 20 14:44:33 2024 +0800

    nuttx/semaphore: Move define CONFIG_SEM_PREALLOCHOLDERS to include/semaphore.h.
    
    Move CONFIG_SEM_PREALLOCHOLDERS to include/semaphore.h to avoid undefined issues from occurring in other places as well.
    
    Signed-off-by: cuiziwei <cu...@xiaomi.com>
---
 include/semaphore.h          | 4 ++++
 sched/semaphore/sem_holder.c | 6 ------
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/include/semaphore.h b/include/semaphore.h
index 284973836e..bfd96cab57 100644
--- a/include/semaphore.h
+++ b/include/semaphore.h
@@ -51,6 +51,10 @@
 
 #define SEM_FAILED                NULL
 
+#ifndef CONFIG_SEM_PREALLOCHOLDERS
+#  define CONFIG_SEM_PREALLOCHOLDERS 0
+#endif
+
 /****************************************************************************
  * Public Type Declarations
  ****************************************************************************/
diff --git a/sched/semaphore/sem_holder.c b/sched/semaphore/sem_holder.c
index 0c23f8aabf..1da9f3e2a9 100644
--- a/sched/semaphore/sem_holder.c
+++ b/sched/semaphore/sem_holder.c
@@ -42,12 +42,6 @@
  * Pre-processor Definitions
  ****************************************************************************/
 
-/* Configuration ************************************************************/
-
-#ifndef CONFIG_SEM_PREALLOCHOLDERS
-#  define CONFIG_SEM_PREALLOCHOLDERS 0
-#endif
-
 /****************************************************************************
  * Private Type Declarations
  ****************************************************************************/