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/include/semaphore.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'nuttx/include/semaphore.h') diff --git a/nuttx/include/semaphore.h b/nuttx/include/semaphore.h index 5372d4212..8061d3d5d 100644 --- a/nuttx/include/semaphore.h +++ b/nuttx/include/semaphore.h @@ -58,6 +58,19 @@ extern "C" { * Public Type Declarations ****************************************************************************/ +/* This structure contains the holder of a semaphore */ + +#ifdef CONFIG_PRIORITY_INHERITANCE +struct semholder_s +{ +#if !defined(CONFIG_SEM_PREALLOCHOLDERS) || CONFIG_SEM_PREALLOCHOLDERS > 0 + struct semholder_s *flink; /* Implements singly linked list */ +#endif + void *holder; /* Holder TCB (actual type is _TCB) */ + sint16 counts; /* Number of counts owned by this holder */ +}; +#endif + /* This is the generic semaphore structure. */ struct sem_s @@ -65,7 +78,7 @@ struct sem_s sint16 semcount; /* >0 -> Num counts available */ /* <0 -> Num tasks waiting for semaphore */ #ifdef CONFIG_PRIORITY_INHERITANCE - void *holder; /* Holder TCB (actual type is _TCB) */ + struct semholder_s hlist; /* List of holders of semaphore counts */ #endif }; typedef struct sem_s sem_t; -- cgit v1.2.3