summaryrefslogtreecommitdiff
path: root/nuttx/include/semaphore.h
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-02-05 17:36:13 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-02-05 17:36:13 +0000
commitd8a039ee18825d1f29e0c020ae6569453fb7bb4f (patch)
treef5b452486749985de7826e7deb82d4752deabe58 /nuttx/include/semaphore.h
parentefb4bf7dca5d637268c6d70eec2880352047e34c (diff)
downloadnuttx-d8a039ee18825d1f29e0c020ae6569453fb7bb4f.tar.gz
nuttx-d8a039ee18825d1f29e0c020ae6569453fb7bb4f.tar.bz2
nuttx-d8a039ee18825d1f29e0c020ae6569453fb7bb4f.zip
FTPD daemon and example now build without errors
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4371 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/include/semaphore.h')
-rw-r--r--nuttx/include/semaphore.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/nuttx/include/semaphore.h b/nuttx/include/semaphore.h
index 7eea3a41b..dd1754d69 100644
--- a/nuttx/include/semaphore.h
+++ b/nuttx/include/semaphore.h
@@ -71,7 +71,13 @@ struct semholder_s
void *holder; /* Holder TCB (actual type is _TCB) */
int16_t counts; /* Number of counts owned by this holder */
};
+
+#if CONFIG_SEM_PREALLOCHOLDERS > 0
+# define SEMHOLDER_INITIALIZER {NULL, NULL, 0}
+#else
+# define SEMHOLDER_INITIALIZER {NULL, 0}
#endif
+#endif /* CONFIG_PRIORITY_INHERITANCE */
/* This is the generic semaphore structure. */
@@ -85,6 +91,12 @@ struct sem_s
};
typedef struct sem_s sem_t;
+#ifdef CONFIG_PRIORITY_INHERITANCE
+# define SEM_INITIALIZER(c) {(c), SEMHOLDER_INITIALIZER}
+#else
+# define SEM_INITIALIZER(c) {(c)}
+#endif
+
/****************************************************************************
* Public Variables
****************************************************************************/