mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-06 13:28:53 +08:00
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:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user