Fix some list handling associated with priority inheritance

git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@5053 7fd9a85b-ad96-42d3-883c-3090e2eb8679
This commit is contained in:
patacongo
2012-08-26 21:35:14 +00:00
parent d6b8fcdcf0
commit fe493d8bb8
8 changed files with 113 additions and 79 deletions
+16 -7
View File
@@ -60,16 +60,16 @@ extern "C" {
* Public Type Declarations
****************************************************************************/
/* This structure contains the holder of a semaphore */
/* This structure contains information about the holder of a semaphore */
#ifdef CONFIG_PRIORITY_INHERITANCE
struct semholder_s
{
#if CONFIG_SEM_PREALLOCHOLDERS > 0
struct semholder_s *flink; /* Implements singly linked list */
struct semholder_s *flink; /* Implements singly linked list */
#endif
void *holder; /* Holder TCB (actual type is _TCB) */
int16_t counts; /* Number of counts owned by this holder */
void *htcb; /* Holder TCB (actual type is _TCB) */
int16_t counts; /* Number of counts owned by this holder */
};
#if CONFIG_SEM_PREALLOCHOLDERS > 0
@@ -83,12 +83,21 @@ struct semholder_s
struct sem_s
{
int16_t semcount; /* >0 -> Num counts available */
/* <0 -> Num tasks waiting for semaphore */
int16_t semcount; /* >0 -> Num counts available */
/* <0 -> Num tasks waiting for semaphore */
/* If priority inheritance is enabled, then we have to keep track of which
* tasks hold references to the semaphore.
*/
#ifdef CONFIG_PRIORITY_INHERITANCE
struct semholder_s hlist; /* List of holders of semaphore counts */
# if CONFIG_SEM_PREALLOCHOLDERS > 0
FAR struct semholder_s *hhead; /* List of holders of semaphore counts */
# else
struct semholder_s holder; /* Single holder */
# endif
#endif
};
typedef struct sem_s sem_t;
/* Initializers */