summaryrefslogtreecommitdiff
path: root/nuttx/sched/sem_init.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-03-10 11:41:20 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-03-10 11:41:20 +0000
commit29bc7ab1359bd069c7a4909ed8694177d9482542 (patch)
tree2667b81118d1f7e63d73d5618b3aec0a4af72de4 /nuttx/sched/sem_init.c
parent43adb41c631a293d6101ffbae760c8d4baeb51ac (diff)
downloadpx4-nuttx-29bc7ab1359bd069c7a4909ed8694177d9482542.tar.gz
px4-nuttx-29bc7ab1359bd069c7a4909ed8694177d9482542.tar.bz2
px4-nuttx-29bc7ab1359bd069c7a4909ed8694177d9482542.zip
Extend, improve, and partially fix priority inheritance logic
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1590 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/sched/sem_init.c')
-rw-r--r--nuttx/sched/sem_init.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/nuttx/sched/sem_init.c b/nuttx/sched/sem_init.c
index b9280d22e..05485a600 100644
--- a/nuttx/sched/sem_init.c
+++ b/nuttx/sched/sem_init.c
@@ -1,7 +1,7 @@
/****************************************************************************
* sched/sem_init.c
*
- * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -43,10 +43,6 @@
#include "sem_internal.h"
/****************************************************************************
- * Compilation Switches
- ****************************************************************************/
-
-/****************************************************************************
* Definitions
****************************************************************************/
@@ -101,7 +97,12 @@ int sem_init (FAR sem_t *sem, int pshared, unsigned int value)
if (sem && value <= SEM_VALUE_MAX)
{
- sem->semcount = (sint16)value;
+ sem->semcount = (sint16)value;
+#ifdef CONFIG_PRIORITY_INHERITANCE
+ sem->hlist.flink = NULL;
+ sem->hlist.holder = NULL;
+ sem->hlist.counts = 0;
+#endif
ret = OK;
}