From 29bc7ab1359bd069c7a4909ed8694177d9482542 Mon Sep 17 00:00:00 2001 From: patacongo Date: Tue, 10 Mar 2009 11:41:20 +0000 Subject: 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 --- nuttx/sched/sem_init.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'nuttx/sched/sem_init.c') 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 * * Redistribution and use in source and binary forms, with or without @@ -42,10 +42,6 @@ #include #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; } -- cgit v1.2.3