aboutsummaryrefslogtreecommitdiff
path: root/nuttx/include
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2013-01-06 17:34:03 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2013-01-06 17:34:03 +0000
commitfe4b34bdedf8004ce14843f9d3dd16bff1d8693a (patch)
tree631065aa709118050afbbb6ffade2d87b8017f43 /nuttx/include
parent0d86268de677a844efa345638650dcaa6bf12764 (diff)
downloadpx4-firmware-fe4b34bdedf8004ce14843f9d3dd16bff1d8693a.tar.gz
px4-firmware-fe4b34bdedf8004ce14843f9d3dd16bff1d8693a.tar.bz2
px4-firmware-fe4b34bdedf8004ce14843f9d3dd16bff1d8693a.zip
Fix SEM_INITIALIZER
git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5483 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/include')
-rw-r--r--nuttx/include/semaphore.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/nuttx/include/semaphore.h b/nuttx/include/semaphore.h
index 257a5826f..203118bd6 100644
--- a/nuttx/include/semaphore.h
+++ b/nuttx/include/semaphore.h
@@ -1,7 +1,7 @@
/****************************************************************************
* include/semaphore.h
*
- * Copyright (C) 2007-2009, 2012 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007-2009, 2012-2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -103,9 +103,13 @@ typedef struct sem_s sem_t;
/* Initializers */
#ifdef CONFIG_PRIORITY_INHERITANCE
-# define SEM_INITIALIZER(c) {(c), SEMHOLDER_INITIALIZER}
+# if CONFIG_SEM_PREALLOCHOLDERS > 0
+# define SEM_INITIALIZER(c) {(c), NULL} /* semcount, hhead */
+# else
+# define SEM_INITIALIZER(c) {(c), SEMHOLDER_INITIALIZER} /* semcount, holder */
+# endif
#else
-# define SEM_INITIALIZER(c) {(c)}
+# define SEM_INITIALIZER(c) {(c)} /* semcount */
#endif
/****************************************************************************