diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2009-03-10 11:41:20 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2009-03-10 11:41:20 +0000 |
commit | 29bc7ab1359bd069c7a4909ed8694177d9482542 (patch) | |
tree | 2667b81118d1f7e63d73d5618b3aec0a4af72de4 /nuttx/include/semaphore.h | |
parent | 43adb41c631a293d6101ffbae760c8d4baeb51ac (diff) | |
download | px4-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/include/semaphore.h')
-rw-r--r-- | nuttx/include/semaphore.h | 15 |
1 files changed, 14 insertions, 1 deletions
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; |