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
This commit is contained in:
patacongo
2009-03-10 11:41:20 +00:00
parent 338d225af9
commit 8e93df66c6
9 changed files with 588 additions and 103 deletions
+14 -1
View File
@@ -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;